Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323846
b: refs/heads/master
c: 499a4f3
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov committed Sep 15, 2012
1 parent c74784f commit 43aa7db
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f68f672c47b9bd4cfe0a667ecb0b1382c61e2de
refs/heads/master: 499a4f3ec057a0f79636cc3c1e581bb6e977a30f
22 changes: 22 additions & 0 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,25 @@ static bool can_skip_sstep(struct uprobe *uprobe, struct pt_regs *regs)
return false;
}

static void mmf_recalc_uprobes(struct mm_struct *mm)
{
struct vm_area_struct *vma;

for (vma = mm->mmap; vma; vma = vma->vm_next) {
if (!valid_vma(vma, false))
continue;
/*
* This is not strictly accurate, we can race with
* uprobe_unregister() and see the already removed
* uprobe if delete_uprobe() was not yet called.
*/
if (vma_has_uprobes(vma, vma->vm_start, vma->vm_end))
return;
}

clear_bit(MMF_HAS_UPROBES, &mm->flags);
}

static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
{
struct mm_struct *mm = current->mm;
Expand All @@ -1417,6 +1436,9 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
} else {
*is_swbp = -EFAULT;
}

if (!uprobe && test_and_clear_bit(MMF_RECALC_UPROBES, &mm->flags))
mmf_recalc_uprobes(mm);
up_read(&mm->mmap_sem);

return uprobe;
Expand Down

0 comments on commit 43aa7db

Please sign in to comment.