Messages in this thread | | | Date | Mon, 30 Mar 2009 18:45:39 -0500 | From | "Serge E. Hallyn" <> | Subject | Re: Q: check_unsafe_exec() races (Was: [PATCH 2/4] fix setuid sometimes doesn't) |
| |
Quoting Al Viro (viro@ZenIV.linux.org.uk): > On Mon, Mar 30, 2009 at 03:40:40AM +0200, Oleg Nesterov wrote: > > > > 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. > > Nah, easier to have check_unsafe_exec() return -EAGAIN in cases we care > about. > > Anyway, completely untested patchset is in > git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6.git/ execve-mess > (the last 9 changesets of it). > > WARNING: that's *NOT* for merge at the moment; this is not a pull request. > > Review (and testing) would be welcome.
(note exactly *meaningful* review, but)
exit_fs() and daemonize_fs_struct() do:
if (--fs->users) fs = NULL; write_unlock(&fs->lock);
Moving the write_unlock up actually let's the kernel boot and start running ltp.
-serge
| |