Sasha Levin 08fa29d916 mm: fix NULL ptr deref when walking hugepages
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>
Cc: <stable@vger.kernel.org>		[3.4.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:18 -07:00
..
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-04-13 13:50:52 -04:00
2012-05-29 10:43:51 -07:00
2011-03-31 11:26:23 -03:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-03-20 21:29:52 -04:00
2012-03-20 21:29:38 -04:00
2012-05-28 09:54:45 -07:00
2012-03-30 17:31:56 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-03-20 21:29:46 -04:00
2012-03-20 21:29:46 -04:00
2012-05-28 09:54:45 -07:00
2012-01-03 22:52:39 -05:00
2012-05-28 09:54:45 -07:00
2012-03-20 21:29:38 -04:00