|
@@ -60,8 +60,6 @@ static struct percpu_rw_semaphore dup_mmap_sem;
|
|
|
|
|
|
/* Have a copy of original instruction */
|
|
|
#define UPROBE_COPY_INSN 0
|
|
|
-/* Can skip singlestep */
|
|
|
-#define UPROBE_SKIP_SSTEP 1
|
|
|
|
|
|
struct uprobe {
|
|
|
struct rb_node rb_node; /* node in the rb tree */
|
|
@@ -491,12 +489,9 @@ static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset)
|
|
|
uprobe->offset = offset;
|
|
|
init_rwsem(&uprobe->register_rwsem);
|
|
|
init_rwsem(&uprobe->consumer_rwsem);
|
|
|
- /* For now assume that the instruction need not be single-stepped */
|
|
|
- __set_bit(UPROBE_SKIP_SSTEP, &uprobe->flags);
|
|
|
|
|
|
/* add to uprobes_tree, sorted on inode:offset */
|
|
|
cur_uprobe = insert_uprobe(uprobe);
|
|
|
-
|
|
|
/* a uprobe exists for this inode:offset combination */
|
|
|
if (cur_uprobe) {
|
|
|
kfree(uprobe);
|
|
@@ -1628,20 +1623,6 @@ bool uprobe_deny_signal(void)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * Avoid singlestepping the original instruction if the original instruction
|
|
|
- * is a NOP or can be emulated.
|
|
|
- */
|
|
|
-static bool can_skip_sstep(struct uprobe *uprobe, struct pt_regs *regs)
|
|
|
-{
|
|
|
- if (test_bit(UPROBE_SKIP_SSTEP, &uprobe->flags)) {
|
|
|
- if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
|
|
|
- return true;
|
|
|
- clear_bit(UPROBE_SKIP_SSTEP, &uprobe->flags);
|
|
|
- }
|
|
|
- return false;
|
|
|
-}
|
|
|
-
|
|
|
static void mmf_recalc_uprobes(struct mm_struct *mm)
|
|
|
{
|
|
|
struct vm_area_struct *vma;
|
|
@@ -1868,13 +1849,13 @@ static void handle_swbp(struct pt_regs *regs)
|
|
|
|
|
|
handler_chain(uprobe, regs);
|
|
|
|
|
|
- if (can_skip_sstep(uprobe, regs))
|
|
|
+ if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
|
|
|
goto out;
|
|
|
|
|
|
if (!pre_ssout(uprobe, regs, bp_vaddr))
|
|
|
return;
|
|
|
|
|
|
- /* can_skip_sstep() succeeded, or restart if can't singlestep */
|
|
|
+ /* arch_uprobe_skip_sstep() succeeded, or restart if can't singlestep */
|
|
|
out:
|
|
|
put_uprobe(uprobe);
|
|
|
}
|