proc: fix oops on invalid /proc/<pid>/maps access, CVE-2011-1020
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Mar 2011 02:09:29 +0000 (19:09 -0700)
committerHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Mon, 29 Aug 2011 19:23:10 +0000 (16:23 -0300)
commitfac0cc03a0365ec277efa21c244972e1fd35c327
tree11b841337e6bd5121737f5dc369e808b24a1a788
parent1de81dac0d2cdf603f2a1c7e37628e5d689b2df9
proc: fix oops on invalid /proc/<pid>/maps access, CVE-2011-1020

When m_start returns an error, the seq_file logic will still call m_stop
with that error entry, so we'd better make sure that we check it before
using it as a vma.

Introduced by commit ec6fd8a4355c ("report errors in /proc/*/*map*
sanely"), which replaced NULL with various ERR_PTR() cases.

(On ia64, you happen to get a unaligned fault instead of a page fault,
since the address used is generally some random error code like -EPERM)

Reported-by: Anca Emanuel <anca.emanuel@gmail.com>
Reported-by: Tony Luck <tony.luck@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Américo Wang <xiyou.wangcong@gmail.com>
Cc: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 76597cd31470fa130784c78fadb4dab2e624a723)
CVE-2011-1020
BugLink: http://bugs.launchpad.net/bugs/813026
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/proc/task_mmu.c