diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-06-15 11:43:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-06-16 03:10:41 -0400 |
commit | ea131377148cdfe90641b42ae9aa5a6b3a4fa327 (patch) | |
tree | 5f8f6063fe35affd268054b762dd18877dfa44ef | |
parent | e2b297fcf17fc03734e93387fb8195c782286b35 (diff) |
uprobes: Valid_vma() should reject VM_HUGETLB
__replace_page() obviously can't work with the hugetlbfs
mappings, uprobe_register() will likely crash the kernel. Change
valid_vma() to check VM_HUGETLB as well.
As for PageTransHuge() no need to worry, vma->vm_file != NULL.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anton Arapov <anton@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120615154322.GA9561@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/events/uprobes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index b52376d02332..f0d04530af63 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -99,7 +99,8 @@ static bool valid_vma(struct vm_area_struct *vma, bool is_register) | |||
99 | if (!is_register) | 99 | if (!is_register) |
100 | return true; | 100 | return true; |
101 | 101 | ||
102 | if ((vma->vm_flags & (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)) == (VM_READ|VM_EXEC)) | 102 | if ((vma->vm_flags & (VM_HUGETLB|VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)) |
103 | == (VM_READ|VM_EXEC)) | ||
103 | return true; | 104 | return true; |
104 | 105 | ||
105 | return false; | 106 | return false; |