aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/events/uprobes.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index b03256cced52..cdc3c951251c 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -823,12 +823,13 @@ static int register_for_each_vma(struct uprobe *uprobe, bool is_register)
823 goto free; 823 goto free;
824 824
825 down_write(&mm->mmap_sem); 825 down_write(&mm->mmap_sem);
826 vma = find_vma(mm, (unsigned long)info->vaddr); 826 vma = find_vma(mm, info->vaddr);
827 if (!vma || !valid_vma(vma, is_register)) 827 if (!vma || !valid_vma(vma, is_register) ||
828 vma->vm_file->f_mapping->host != uprobe->inode)
828 goto unlock; 829 goto unlock;
829 830
830 if (vma->vm_file->f_mapping->host != uprobe->inode || 831 if (vma->vm_start > info->vaddr ||
831 vma_address(vma, uprobe->offset) != info->vaddr) 832 vaddr_to_offset(vma, info->vaddr) != uprobe->offset)
832 goto unlock; 833 goto unlock;
833 834
834 if (is_register) { 835 if (is_register) {