Re: [kernel-hardening] RLIMIT_NPROC check in set_user()

Solar Designer
2011-07-11T16:59:00Z

Vasiliy,

On Wed, Jul 06, 2011 at 10:59:32PM +0400, Vasiliy Kulikov wrote:
> On Wed, Jul 06, 2011 at 11:01 -0700, Linus Torvalds wrote:
> > My reaction is: "let's just remote the crazy check from set_user()
> > entirely".
>
> Honestly, I didn't expect such a positive reaction from you in the first
> reply :)

After this is taken care of, please also consider other ways set*id()
syscalls might fail on errors unrelated to the process possessing
appropriate privileges. IIRC, set_user() could also fail when it's not
able to allocate an instance of "struct user" - unlikely, but possible.
I think the process must be killed on those errors. There's no better
action to take on them.

Thanks,

Alexander