All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-fix-null-ptr-deref-when-walking-hugepages.patch added to -mm tree
@ 2012-05-23 22:26 ` akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2012-05-23 22:26 UTC (permalink / raw)
  To: mm-commits
  Cc: levinsasha928, aarcange, andi, kamezawa.hiroyu, kosaki.motohiro,
	n-horiguchi, rientjes, stable


The patch titled
     Subject: mm: fix NULL ptr deref when walking hugepages
has been added to the -mm tree.  Its filename is
     mm-fix-null-ptr-deref-when-walking-hugepages.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sasha Levin <levinsasha928@gmail.com>
Subject: mm: fix NULL ptr deref when walking hugepages

A missing vlidation 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 025c5b24 ("thp: optimize away unnecessary page table
locking").

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Cc: 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>
Cc: <stable@vger.kernel.org>		[3.4.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

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

diff -puN fs/proc/task_mmu.c~mm-fix-null-ptr-deref-when-walking-hugepages fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c~mm-fix-null-ptr-deref-when-walking-hugepages
+++ a/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;
 
_
Subject: Subject: mm: fix NULL ptr deref when walking hugepages

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

origin.patch
linux-next.patch
mm-fix-null-ptr-deref-when-walking-hugepages.patch
locking-add-kern_cont-when-needed-to-self-test.patch
x86-nmi-add-missing-kern_cont-to-nmi-selftest.patch
isdn-add-missing-kern_cont.patch
isdn-add-missing-kern_cont-fix.patch
ipc-mqueue-improve-performance-of-send-recv-use-correct-gfp-flags-in-msg_insert.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* + mm-fix-null-ptr-deref-when-walking-hugepages.patch added to -mm tree
@ 2012-05-23 22:26 ` akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2012-05-23 22:26 UTC (permalink / raw)
  To: mm-commits
  Cc: levinsasha928, aarcange, andi, kamezawa.hiroyu, kosaki.motohiro,
	n-horiguchi, rientjes, stable


The patch titled
     Subject: mm: fix NULL ptr deref when walking hugepages
has been added to the -mm tree.  Its filename is
     mm-fix-null-ptr-deref-when-walking-hugepages.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sasha Levin <levinsasha928@gmail.com>
Subject: mm: fix NULL ptr deref when walking hugepages

A missing vlidation 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 025c5b24 ("thp: optimize away unnecessary page table
locking").

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Cc: 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>
Cc: <stable@vger.kernel.org>		[3.4.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

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

diff -puN fs/proc/task_mmu.c~mm-fix-null-ptr-deref-when-walking-hugepages fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c~mm-fix-null-ptr-deref-when-walking-hugepages
+++ a/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;
 
_
Subject: Subject: mm: fix NULL ptr deref when walking hugepages

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

origin.patch
linux-next.patch
mm-fix-null-ptr-deref-when-walking-hugepages.patch
locking-add-kern_cont-when-needed-to-self-test.patch
x86-nmi-add-missing-kern_cont-to-nmi-selftest.patch
isdn-add-missing-kern_cont.patch
isdn-add-missing-kern_cont-fix.patch
ipc-mqueue-improve-performance-of-send-recv-use-correct-gfp-flags-in-msg_insert.patch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-23 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 22:26 + mm-fix-null-ptr-deref-when-walking-hugepages.patch added to -mm tree akpm
2012-05-23 22:26 ` akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.