aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/events/uprobes.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index a1b466d17c17..c718fef28617 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -596,6 +596,7 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm,
596 BUG_ON((uprobe->offset & ~PAGE_MASK) + 596 BUG_ON((uprobe->offset & ~PAGE_MASK) +
597 UPROBE_SWBP_INSN_SIZE > PAGE_SIZE); 597 UPROBE_SWBP_INSN_SIZE > PAGE_SIZE);
598 598
599 smp_wmb(); /* pairs with rmb() in find_active_uprobe() */
599 uprobe->flags |= UPROBE_COPY_INSN; 600 uprobe->flags |= UPROBE_COPY_INSN;
600 } 601 }
601 602
@@ -1436,6 +1437,14 @@ static void handle_swbp(struct pt_regs *regs)
1436 } 1437 }
1437 return; 1438 return;
1438 } 1439 }
1440 /*
1441 * TODO: move copy_insn/etc into _register and remove this hack.
1442 * After we hit the bp, _unregister + _register can install the
1443 * new and not-yet-analyzed uprobe at the same address, restart.
1444 */
1445 smp_rmb(); /* pairs with wmb() in install_breakpoint() */
1446 if (unlikely(!(uprobe->flags & UPROBE_COPY_INSN)))
1447 goto restart;
1439 1448
1440 utask = current->utask; 1449 utask = current->utask;
1441 if (!utask) { 1450 if (!utask) {