summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-02-10 15:01:22 -0800
committerWilly Tarreau <w@1wt.eu>2011-04-30 16:52:59 +0200
commit8c4cabbf2516c203b76eeef04d03b260aeb6a941 (patch)
tree1eba2115f5fb340b61d4d71d6c09d2198b4cc079 /init
parent2132f453404eae628e4bd19c2bf9652f49f75f57 (diff)
ptrace: use safer wake up on ptrace_detach()
commit 01e05e9a90b8f4c3997ae0537e87720eb475e532 upstream. The wake_up_process() call in ptrace_detach() is spurious and not interlocked with the tracee state. IOW, the tracee could be running or sleeping in any place in the kernel by the time wake_up_process() is called. This can lead to the tracee waking up unexpectedly which can be dangerous. The wake_up is spurious and should be removed but for now reduce its toxicity by only waking up if the tracee is in TRACED or STOPPED state. This bug can possibly be used as an attack vector. I don't think it will take too much effort to come up with an attack which triggers oops somewhere. Most sleeps are wrapped in condition test loops and should be safe but we have quite a number of places where sleep and wakeup conditions are expected to be interlocked. Although the window of opportunity is tiny, ptrace can be used by non-privileged users and with some loading the window can definitely be extended and exploited. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions