From: Oleg Nesterov Date: Fri, 6 Jun 2014 21:36:44 +0000 (-0700) Subject: ptrace: task_clear_jobctl_trapping()->wake_up_bit() needs mb() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=650226bd95817d727c9a388752d72ef292c4a668;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ptrace: task_clear_jobctl_trapping()->wake_up_bit() needs mb() __wake_up_bit() checks waitqueue_active() and thus the caller needs mb() as wake_up_bit() documents, fix task_clear_jobctl_trapping(). Signed-off-by: Oleg Nesterov Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/signal.c b/kernel/signal.c index 6e600aaa2af4..9b5453ee5f5e 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -277,6 +277,7 @@ void task_clear_jobctl_trapping(struct task_struct *task) { if (unlikely(task->jobctl & JOBCTL_TRAPPING)) { task->jobctl &= ~JOBCTL_TRAPPING; + smp_mb(); /* advised by wake_up_bit() */ wake_up_bit(&task->jobctl, JOBCTL_TRAPPING_BIT); } }