Re: [PATCH 2/2] kernel/fork: handle put_user errors for CLONE_PARENT_SETTID

2015-02-06 Thread Linus Torvalds
On Fri, Feb 6, 2015 at 1:13 PM, Konstantin Khlebnikov wrote: > > Currently that works fine only because kernel retries 0-order allocations > endlessly. But pagefault_out_of_memory() is never called for non-user PF. > For kernel PF all oom-kills are triggered by buddy-allocator. This makes no sens

Re: [PATCH 2/2] kernel/fork: handle put_user errors for CLONE_PARENT_SETTID

2015-02-06 Thread Andy Lutomirski
On Fri, Feb 6, 2015 at 1:13 PM, Konstantin Khlebnikov wrote: > On Fri, Feb 6, 2015 at 11:49 PM, Linus Torvalds > wrote: >> On Fri, Feb 6, 2015 at 8:23 AM, Konstantin Khlebnikov >> wrote: >>> Handling of flag CLONE_PARENT_SETTID has the same problem: error returned >>> from put_user() is ignored.

Re: [PATCH 2/2] kernel/fork: handle put_user errors for CLONE_PARENT_SETTID

2015-02-06 Thread Konstantin Khlebnikov
On Fri, Feb 6, 2015 at 11:49 PM, Linus Torvalds wrote: > On Fri, Feb 6, 2015 at 8:23 AM, Konstantin Khlebnikov > wrote: >> Handling of flag CLONE_PARENT_SETTID has the same problem: error returned >> from put_user() is ignored. Glibc completely relies on that feature and uses >> value returned fr

Re: [PATCH 2/2] kernel/fork: handle put_user errors for CLONE_PARENT_SETTID

2015-02-06 Thread Oleg Nesterov
I am not sure about these changes too, but On 02/06, Linus Torvalds wrote: > > What's the upside? If somebody passes in a bad pointer, it's their > problem. Yes. But unless I am totally confused (quite possible) this put_user() can fail even if the pointer is valid. So at least I think Konstanti

Re: [PATCH 2/2] kernel/fork: handle put_user errors for CLONE_PARENT_SETTID

2015-02-06 Thread Linus Torvalds
On Fri, Feb 6, 2015 at 8:23 AM, Konstantin Khlebnikov wrote: > Handling of flag CLONE_PARENT_SETTID has the same problem: error returned > from put_user() is ignored. Glibc completely relies on that feature and uses > value returned from syscall only for error checking. I'm not seeing the advanta

[PATCH 2/2] kernel/fork: handle put_user errors for CLONE_PARENT_SETTID

2015-02-06 Thread Konstantin Khlebnikov
Handling of flag CLONE_PARENT_SETTID has the same problem: error returned from put_user() is ignored. Glibc completely relies on that feature and uses value returned from syscall only for error checking. Kernels older than v2.6.24 handled that correctly but check has been removed in commit 30e49c2