[clue-tech] Filesystem quotas circumvented

Angelo Bertolli angelo at freeshell.org
Wed Jan 19 09:50:49 MST 2005


Keith Hellman wrote:

>On Tue, Jan 18, 2005 at 05:09:09PM -0700, Keith Hellman wrote:
>  
>
>>But, the process *writing* into ~/lsr has an effective user id of root
>>(it is the sudo binary). My guess is that it is the process uid & gid
>>that quota is considering, not the file owner's (angelo's) quota limits.
>>    
>>
>
>Just for clarity (and without, again, *any* knowledge of quota
>internals), I think I'm wrong above.  It seems more 'the unix way' that
>a priviledged process is never quota-impaired (after all root should
>know what he/she is doing).  Suppose the command was actually
>  [angelo]$ su fred -c "yes" > ~/angelos_home_file
>I doubt that the kernel would actually begin using fred's quota
>parameters, quota parameters seem most appriately stuck to the file
>itself.  In the case that a priviledged process is writing, those
>parameters are simply ignored.
>
>Does anyone (Angelo?) have the inclination to test this quickly?  I'd be
>curious of the results but don't have the time to setup (aka learn)
>quota.  Specifically the question would be:
>
>  Does the operation
>    [angelo]$ su fred -c "yes" > ~/angelos_home_file
>  follow fred's quota restrictions, angelo's quota restrictions, or no
>  quota restrictions.
>
>  
>
I just tested this and it follows angelo's quota restrictions 
precisely.  I tried making the other user with a quota above and tried 
with a quota below angelo's quota.  They both ended with:

Disk quotas for user angelo (uid 635):
     Filesystem  blocks   quota   limit
      /dev/hda2  150000* 100000  150000

And... I think you and Dave are right about this:  the rooted process 
overrides restrictions put on it by other processes.  (I presume the 
system sends some kind of kill signal to the process, which the rooted 
process can ignore.)

Angelo




More information about the clue-tech mailing list