mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
Ptrace_detach() races with __ptrace_unlink() if the traced task is reaped while detaching. This might cause a double-free of the BTS buffer. Change the ptrace_detach() path to only do the memory accounting in ptrace_bts_detach() and leave the buffer free to ptrace_bts_untrace() which will be called from __ptrace_unlink(). The fix follows a proposal from Oleg Nesterov. Reported-by: Oleg Nesterov <[email protected]> Signed-off-by: Markus Metzger <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>