From 9ffaeaad3e2f8609539829acc66423adbb6a4cab Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Sun, 16 Sep 2012 19:31:39 +0200 Subject: [PATCH] --- yaml --- r: 334758 b: refs/heads/master c: e40cfce626a5537994058ee9a940dcfdc0f68ef0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/events/uprobes.c | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 60c6af9fb000..bbfc91b62e95 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 78a320542e6cdb2800cd736b2d136e4261d34f43 +refs/heads/master: e40cfce626a5537994058ee9a940dcfdc0f68ef0 diff --git a/trunk/kernel/events/uprobes.c b/trunk/kernel/events/uprobes.c index a9de40815391..8d182bdecc2e 100644 --- a/trunk/kernel/events/uprobes.c +++ b/trunk/kernel/events/uprobes.c @@ -100,17 +100,12 @@ struct uprobe { */ static bool valid_vma(struct vm_area_struct *vma, bool is_register) { - if (!vma->vm_file) - return false; - - if (!is_register) - return true; + vm_flags_t flags = VM_HUGETLB | VM_MAYEXEC | VM_SHARED; - if ((vma->vm_flags & (VM_HUGETLB | VM_WRITE | VM_MAYEXEC | VM_SHARED)) - == VM_MAYEXEC) - return true; + if (is_register) + flags |= VM_WRITE; - return false; + return vma->vm_file && (vma->vm_flags & flags) == VM_MAYEXEC; } static unsigned long offset_to_vaddr(struct vm_area_struct *vma, loff_t offset)