diff options
author | Oleg Nesterov <oleg@redhat.com> | 2015-07-10 00:25:47 +0200 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2015-07-19 21:51:17 +0200 |
commit | cda2495ab448119db5ae7d3d1cdc9c6d44934122 (patch) | |
tree | d664ffdc74efc1b7b14cb14e5e7361e535364b14 | |
parent | 6522ed40cc5b3d570cb7f2baccfbaefe339326c7 (diff) | |
download | misc-uprobes/core.tar.gz |
uprobes: fix the waitqueue_active() check in xol_free_insn_slot()uprobes/core
The xol_free_insn_slot()->waitqueue_active() check is buggy. We need
mb() after we set the conditon for wait_event(), or xol_take_insn_slot()
can miss the wakeup.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
-rw-r--r-- | kernel/events/uprobes.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 2d5b7bd337a7c0..4e5e9798aa0c0d 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1337,6 +1337,7 @@ static void xol_free_insn_slot(struct task_struct *tsk) clear_bit(slot_nr, area->bitmap); atomic_dec(&area->slot_count); + smp_mb__after_atomic(); /* pairs with prepare_to_wait() */ if (waitqueue_active(&area->wq)) wake_up(&area->wq); |