• Tejun Heo's avatar
    ptrace: relocate set_current_state(TASK_TRACED) in ptrace_stop() · 81be24b8
    Tejun Heo authored
    In ptrace_stop(), after arch hook is done, the task state and jobctl
    bits are updated while holding siglock.  The ordering requirement
    there is that TASK_TRACED is set before JOBCTL_TRAPPING is cleared to
    prevent ptracer waiting on TRAPPING doesn't end up waking up TRACED is
    actually set and sees TASK_RUNNING in wait(2).
    
    Move set_current_state(TASK_TRACED) to the top of the block and
    reorganize comments.  This makes the ordering more obvious
    (TASK_TRACED before other updates) and helps future updates to group
    stop participation.
    
    This patch doesn't cause any functional change.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    81be24b8
signal.c 79.1 KB