mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Hugh Dickins <hughd@google.com>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Anton Arapov <anton@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] uprobes: valid_vma() should reject VM_HUGETLB
Date: Thu, 7 Jun 2012 19:00:02 +0200	[thread overview]
Message-ID: <20120607170002.GA31974@redhat.com> (raw)
In-Reply-To: <20120607165942.GA31966@redhat.com>

__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>
---
 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 6e3b181..48d53af 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -105,7 +105,8 @@ static bool valid_vma(struct vm_area_struct *vma, bool is_register)
 	if (!is_register)
 		return true;
 
-	if ((vma->vm_flags & (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)) == (VM_READ|VM_EXEC))
+	if ((vma->vm_flags & (VM_HUGETLB|VM_READ|VM_WRITE|VM_EXEC|VM_SHARED))
+				== (VM_READ|VM_EXEC))
 		return true;
 
 	return false;
-- 
1.5.5.1



  reply	other threads:[~2012-06-07 17:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 16:59 [PATCH 0/3] uprobes fixes for 3.5 Oleg Nesterov
2012-06-07 17:00 ` Oleg Nesterov [this message]
2012-06-15  6:22   ` [PATCH 1/3] uprobes: valid_vma() should reject VM_HUGETLB Srikar Dronamraju
2012-06-07 17:00 ` [PATCH 2/3] uprobes: __copy_insn() should ensure a_ops->readpage != NULL Oleg Nesterov
2012-06-15  6:25   ` Srikar Dronamraju
2012-06-15 12:10     ` Ingo Molnar
2012-06-07 17:00 ` [PATCH 3/3] uprobes: write_opcode()->__replace_page() can race with try_to_unmap() Oleg Nesterov
2012-06-08  8:47   ` Peter Zijlstra
2012-06-08 10:03     ` Oleg Nesterov
2012-06-08 16:55   ` Oleg Nesterov
2012-06-15  6:12     ` Srikar Dronamraju
2012-06-15 12:11       ` Ingo Molnar
2012-06-15 15:48         ` Oleg Nesterov
2012-06-16  7:11           ` Ingo Molnar
2012-06-08 14:03 ` oom-killer is crazy? (Was: [PATCH 0/3] uprobes fixes for 3.5) Oleg Nesterov
2012-06-08 14:26   ` Dave Jones
2012-06-08 15:04     ` Oleg Nesterov
2012-06-08 20:21       ` [patch for-3.5-rc1] mm, oom: fix badness score underflow David Rientjes
2012-06-09 22:25         ` KOSAKI Motohiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120607170002.GA31974@redhat.com \
    --to=oleg@redhat.com \
    --cc=ananth@in.ibm.com \
    --cc=anton@redhat.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome