Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312211
b: refs/heads/master
c: d790d34
h: refs/heads/master
i:
  312209: ac25f5c
  312207: f33f942
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jun 6, 2012
1 parent 93a2931 commit 70faade
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3a9ea0520f38def4a3915b91f82455b749f07d88
refs/heads/master: d790d34653ab20c74034902f5f0889bba807949a
11 changes: 8 additions & 3 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,15 +1489,14 @@ static bool can_skip_sstep(struct uprobe *uprobe, struct pt_regs *regs)
return false;
}

static struct uprobe *find_active_uprobe(unsigned long bp_vaddr)
static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
{
struct mm_struct *mm = current->mm;
struct uprobe *uprobe = NULL;
struct vm_area_struct *vma;

down_read(&mm->mmap_sem);
vma = find_vma(mm, bp_vaddr);

if (vma && vma->vm_start <= bp_vaddr) {
if (valid_vma(vma, false)) {
struct inode *inode;
Expand All @@ -1508,6 +1507,11 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr)
offset += (vma->vm_pgoff << PAGE_SHIFT);
uprobe = find_uprobe(inode, offset);
}

if (!uprobe)
*is_swbp = is_swbp_at_addr(mm, bp_vaddr);
} else {
*is_swbp = -EFAULT;
}

srcu_read_unlock_raw(&uprobes_srcu, current->uprobe_srcu_id);
Expand All @@ -1526,9 +1530,10 @@ static void handle_swbp(struct pt_regs *regs)
struct uprobe_task *utask;
struct uprobe *uprobe;
unsigned long bp_vaddr;
int is_swbp;

bp_vaddr = uprobe_get_swbp_addr(regs);
uprobe = find_active_uprobe(bp_vaddr);
uprobe = find_active_uprobe(bp_vaddr, &is_swbp);

if (!uprobe) {
/* No matching uprobe; signal SIGTRAP. */
Expand Down

0 comments on commit 70faade

Please sign in to comment.