stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "mm: fix NULL ptr deref when walking hugepages" has been added to the 3.4-stable tree
@ 2012-06-01  8:20 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2012-06-01  8:20 UTC (permalink / raw)
  To: levinsasha928, aarcange, akpm, andi, gregkh, kamezawa.hiroyu,
	kosaki.motohiro, n-horiguchi, rientjes, torvalds
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    mm: fix NULL ptr deref when walking hugepages

to the 3.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mm-fix-null-ptr-deref-when-walking-hugepages.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 08fa29d916c6e271ad13978cd993e7238c68db97 Mon Sep 17 00:00:00 2001
From: Sasha Levin <levinsasha928@gmail.com>
Date: Tue, 29 May 2012 15:06:15 -0700
Subject: mm: fix NULL ptr deref when walking hugepages

From: Sasha Levin <levinsasha928@gmail.com>

commit 08fa29d916c6e271ad13978cd993e7238c68db97 upstream.

A missing validation of the value returned by find_vma() could cause a
NULL ptr dereference when walking the pagetable.

This is triggerable from usermode by a simple user by trying to read a
page info out of /proc/pid/pagemap which doesn't exist.

Introduced by commit 025c5b2451e4 ("thp: optimize away unnecessary page
table locking").

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/proc/task_mmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -784,7 +784,7 @@ static int pagemap_pte_range(pmd_t *pmd,
 
 	/* find the first VMA at or above 'addr' */
 	vma = find_vma(walk->mm, addr);
-	if (pmd_trans_huge_lock(pmd, vma) == 1) {
+	if (vma && pmd_trans_huge_lock(pmd, vma) == 1) {
 		for (; addr != end; addr += PAGE_SIZE) {
 			unsigned long offset;
 


Patches currently in stable-queue which might be from levinsasha928@gmail.com are

queue-3.4/mm-fix-null-ptr-deref-when-walking-hugepages.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-01  8:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-01  8:20 Patch "mm: fix NULL ptr deref when walking hugepages" has been added to the 3.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).