Re: Q: check_unsafe_exec() races (Was: [PATCH 2/4] fix setuid sometimes doesn't)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/30, Oleg Nesterov wrote:
>
> On 03/30, Al Viro wrote:
> >
> > On Mon, Mar 30, 2009 at 02:08:43AM +0100, Al Viro wrote:
> >
> > > So...
> > > 	* check_unsafe_exec() locks current->fs shared, goes through all
> > > threads comparing their ->fs with our, if the number doesn't match - bail
> > > out.  Otherwise we mark it "under exec".
>
> Unless I missed something again, check_unsafe_exec() should check "under exec"
> after it takes fs->lock. If set - we are racing with sub-thread, return -EAGAIN.
>
> We can't proceed. If that another exec() fails, it will clear "under exec" at
> the end of do_execve(), before we kill other threads.

Or we need a counter to mark/unmark.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux