Files
linux/drivers
Julius Werner 1489183c20 drivers: char: mem: Check for address space wraparound with mmap()
commit b299cde245 upstream.

/dev/mem currently allows mmap() mappings that wrap around the end of
the physical address space, which should probably be illegal. It
circumvents the existing STRICT_DEVMEM permission check because the loop
immediately terminates (as the start address is already higher than the
end address). On the x86_64 architecture it will then cause a panic
(from the BUG(start >= end) in arch/x86/mm/pat.c:reserve_memtype()).

This patch adds an explicit check to make sure offset + size will not
wrap around in the physical address type.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 15:44:49 +02:00
..
2016-12-05 14:53:46 -05:00
2017-04-21 09:31:23 +02:00
2017-05-20 14:28:41 +02:00
2016-09-27 12:33:47 +02:00
2017-02-23 17:44:36 +01:00
2016-09-20 20:57:12 +10:00
2017-04-21 09:31:24 +02:00