diff options
| author | Oleg Nesterov <[email protected]> | 2015-02-02 15:05:36 +0100 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2015-02-18 16:57:09 +0100 |
| commit | a21294644623ee41034db60e93aaebed4db0e57b (patch) | |
| tree | 864432246453f636e36544aa601860dde50cc40a /include/linux/compiler-gcc.h | |
| parent | be1f7bf217ebb1e42190d7d0b332c89ea7871378 (diff) | |
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 <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Darren Hart <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Jerome Marchand <[email protected]>
Cc: Larry Woodman <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Mateusz Guzik <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'include/linux/compiler-gcc.h')
0 files changed, 0 insertions, 0 deletions