lkml.org 
[lkml]   [2015]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] futex: check PF_KTHREAD rather than !p->mm to filter out kthreads
On Mon, Feb 02, 2015 at 03:05:36PM +0100, Oleg Nesterov wrote:
> attach_to_pi_owner() checks p->mm to prevent attaching to kthreads and
> this looks doubly wrong:
>
> 1. It should actually check PF_KTHREAD, kthread can do use_mm().
>
> 2. If this task is not kthread and it is actually the lock owner we can
> wrongly return -EPERM instead of -ESRCH or retry-if-EAGAIN.
>
> And note that this wrong EPERM is the likely case unless the exiting
> task is (auto)reaped quickly, we check ->mm before PF_EXITING.
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>


\
 
 \ /
  Last update: 2015-02-04 12:01    [W:0.128 / U:2.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site