[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4A4DD74A.9050708@redhat.com>
Date: Fri, 03 Jul 2009 18:02:50 +0800
From: Amerigo Wang <amwang@...hat.com>
To: Eric Paris <eparis@...hat.com>
CC: Eric Sandeen <sandeen@...hat.com>, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, Eugene Teo <eteo@...hat.com>,
viro@...iv.linux.org.uk
Subject: Re: [Patch] allow file truncations when both suid and write permissions
set
Eric Paris wrote:
> On Thu, 2009-07-02 at 18:14 +0800, Amerigo Wang wrote:
>
>> Eric Paris wrote:
>>
>>> So NAK on both Amerigo's and Eric's patch. ATTR_FORCE is wrong.
>>> ATTR_FORCE here is going to force the security system to accept ALL of
>>> the attr changes, not just the ATTR_KILL_SUID and/or ATTR_KILL_SGID you
>>> |= in from should_remove_suid.
>>> You need to follow esandeen's recommendation, change file_remove_suid()
>>> to dentry_remove_suid() and then use dentry_remove_suid() in do_truncate
>>> instead of what you are currently trying to do (and I think that's
>>> supposed to be done under the i_mutex right?)
>>>
>>>
>> But file_remove_suid() actually adds ATTR_FORCE too, in __remove_suid()...
>>
>
> The difference being that it adds it to a private ia_valid that ONLY
> contains the SUID/SGID bits that we need to force the removal of. Not
> to the ia_valid that contains ATTR_SIZE and ATTR_FILE.
>
Yeah! Got it. I will prepare a new patch...
Thank you!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists