Neil, On Fri, Jul 15, 2011 at 13:30 +1000, NeilBrown wrote: > I'm still bothers that the proposed patch can cause exec to fail for an > separate 'innocent' process. > It also seems to 'hide' the problem - just shuffling code around. > The comment in do_execve_common helps. A similar comment in set_user > wouldn't hurt. > > But what do you think of this. It sure that only the process which ignored > the return value from setuid is inconvenienced. I don't like it. You're mixing the main problem and an RLIMIT check enforcement. The main goal is denying setuid() to fail unless there is not enough privileges, RLIMIT in execve() is just an *attempt* to still count NPROC in *some* widespread cases. But you're trying to fix setuid() where RLIMIT accounting is simple :\ Your patch doesn't address the core issue in this situation: setuid(); /* it fails because of RLIMIT */ do_some_fs(); execve(); do_some_fs() should be called ONLY if root is dropped. In your scheme the process may interact with FS as root while thinking it is nonroot, which almost always leads to privilege escalation. Thanks, -- Vasiliy Kulikov http://www.openwall.com - bringing security into open computing environments -- 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