Skip to content

Commit

Permalink
uprobes: Fix the waitqueue_active() check in xol_free_insn_slot()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Pratyush Anand <[email protected]>
Cc: Srikar Dronamraju <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
oleg-nesterov authored and Ingo Molnar committed Jul 31, 2015
1 parent 704bde3 commit 2a742ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2a742ce

Please sign in to comment.