diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/events/uprobes.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index e4a906ce2e1d..912ef48d28ab 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -1444,6 +1444,16 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp) | |||
1444 | return uprobe; | 1444 | return uprobe; |
1445 | } | 1445 | } |
1446 | 1446 | ||
1447 | void __weak arch_uprobe_enable_step(struct arch_uprobe *arch) | ||
1448 | { | ||
1449 | user_enable_single_step(current); | ||
1450 | } | ||
1451 | |||
1452 | void __weak arch_uprobe_disable_step(struct arch_uprobe *arch) | ||
1453 | { | ||
1454 | user_disable_single_step(current); | ||
1455 | } | ||
1456 | |||
1447 | /* | 1457 | /* |
1448 | * Run handler and ask thread to singlestep. | 1458 | * Run handler and ask thread to singlestep. |
1449 | * Ensure all non-fatal signals cannot interrupt thread while it singlesteps. | 1459 | * Ensure all non-fatal signals cannot interrupt thread while it singlesteps. |
@@ -1490,7 +1500,7 @@ static void handle_swbp(struct pt_regs *regs) | |||
1490 | 1500 | ||
1491 | utask->state = UTASK_SSTEP; | 1501 | utask->state = UTASK_SSTEP; |
1492 | if (!pre_ssout(uprobe, regs, bp_vaddr)) { | 1502 | if (!pre_ssout(uprobe, regs, bp_vaddr)) { |
1493 | user_enable_single_step(current); | 1503 | arch_uprobe_enable_step(&uprobe->arch); |
1494 | return; | 1504 | return; |
1495 | } | 1505 | } |
1496 | 1506 | ||
@@ -1526,10 +1536,10 @@ static void handle_singlestep(struct uprobe_task *utask, struct pt_regs *regs) | |||
1526 | else | 1536 | else |
1527 | WARN_ON_ONCE(1); | 1537 | WARN_ON_ONCE(1); |
1528 | 1538 | ||
1539 | arch_uprobe_disable_step(&uprobe->arch); | ||
1529 | put_uprobe(uprobe); | 1540 | put_uprobe(uprobe); |
1530 | utask->active_uprobe = NULL; | 1541 | utask->active_uprobe = NULL; |
1531 | utask->state = UTASK_RUNNING; | 1542 | utask->state = UTASK_RUNNING; |
1532 | user_disable_single_step(current); | ||
1533 | xol_free_insn_slot(current); | 1543 | xol_free_insn_slot(current); |
1534 | 1544 | ||
1535 | spin_lock_irq(¤t->sighand->siglock); | 1545 | spin_lock_irq(¤t->sighand->siglock); |