Files
twx-linux/drivers
Julius Werner 837bfdb413 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 14:30:18 +02:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-01-12 11:22:47 +01:00
2017-02-23 17:43:10 +01:00
…
…
…
…
…
…
…
2017-04-21 09:30:07 +02:00
…
…
…
…
…
…
…
…
…
…