diff options
Diffstat (limited to 'kernel/events/uprobes.c')
-rw-r--r-- | kernel/events/uprobes.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index a9de40815391..8d182bdecc2e 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -100,17 +100,12 @@ struct uprobe { | |||
100 | */ | 100 | */ |
101 | static bool valid_vma(struct vm_area_struct *vma, bool is_register) | 101 | static bool valid_vma(struct vm_area_struct *vma, bool is_register) |
102 | { | 102 | { |
103 | if (!vma->vm_file) | 103 | vm_flags_t flags = VM_HUGETLB | VM_MAYEXEC | VM_SHARED; |
104 | return false; | ||
105 | |||
106 | if (!is_register) | ||
107 | return true; | ||
108 | 104 | ||
109 | if ((vma->vm_flags & (VM_HUGETLB | VM_WRITE | VM_MAYEXEC | VM_SHARED)) | 105 | if (is_register) |
110 | == VM_MAYEXEC) | 106 | flags |= VM_WRITE; |
111 | return true; | ||
112 | 107 | ||
113 | return false; | 108 | return vma->vm_file && (vma->vm_flags & flags) == VM_MAYEXEC; |
114 | } | 109 | } |
115 | 110 | ||
116 | static unsigned long offset_to_vaddr(struct vm_area_struct *vma, loff_t offset) | 111 | static unsigned long offset_to_vaddr(struct vm_area_struct *vma, loff_t offset) |