proc/kcore: don't bounds check against address 0
authorLaura Abbott <[email protected]>
Fri, 11 May 2018 23:01:57 +0000 (16:01 -0700)
committerLinus Torvalds <[email protected]>
Sat, 12 May 2018 00:28:45 +0000 (17:28 -0700)
commit3955333df9a50e8783d115613a397ae55d905080
tree371edec8aa4acd6f21c17c32efd5f526bce5ee85
parent7aaf7727235870f497eb928f728f7773d6df3b40
proc/kcore: don't bounds check against address 0

The existing kcore code checks for bad addresses against __va(0) with
the assumption that this is the lowest address on the system.  This may
not hold true on some systems (e.g.  arm64) and produce overflows and
crashes.  Switch to using other functions to validate the address range.

It's currently only seen on arm64 and it's not clear if anyone wants to
use that particular combination on a stable release.  So this is not
urgent for stable.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Laura Abbott <[email protected]>
Tested-by: Dave Anderson <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Alexey Dobriyan <[email protected]>a
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/kcore.c