summaryrefslogtreecommitdiffstats
path: root/kernel/locking/rwsem-xadd.c
diff options
context:
space:
mode:
authorOleg Nesterov2015-02-02 15:05:36 +0100
committerIngo Molnar2015-02-18 16:57:09 +0100
commita21294644623ee41034db60e93aaebed4db0e57b (patch)
tree864432246453f636e36544aa601860dde50cc40a /kernel/locking/rwsem-xadd.c
parentlocking/mutex: Refactor mutex_spin_on_owner() (diff)
downloadkernel-qcow2-linux-a21294644623ee41034db60e93aaebed4db0e57b.tar.gz
kernel-qcow2-linux-a21294644623ee41034db60e93aaebed4db0e57b.tar.xz
kernel-qcow2-linux-a21294644623ee41034db60e93aaebed4db0e57b.zip
locking/futex: Check PF_KTHREAD rather than !p->mm to filter out kthreads
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> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Darren Hart <darren@dvhart.com> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mateusz Guzik <mguzik@redhat.com> Link: http://lkml.kernel.org/r/20150202140536.GA26406@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/locking/rwsem-xadd.c')
0 files changed, 0 insertions, 0 deletions