[LTP] [PATCH v3] syscalls/mmap17.c: Add new regression test

Cyril Hrubis chrubis@suse.cz
Wed Apr 4 16:31:57 CEST 2018


Hi!
> We add a regression test to check if mmap() can't map invalid physical
> addresses.  If mmap() maps /dev/mem offsets outside of the addressable
> limits of a system, setting reserved bits corrupts the page table and
> may trigger a kernel crash.

I wonder if we can address Jan's comment and make it more generic by
trying to mmap a certain sequence of offsets in /dev/mem and either
expect them to return a valid pointer or fail with MAP_FAILED. We would
have to make sure that we got the 1ULL<<phys_addr_bits there for the x86
case but we wouldn't have to skip the test on non-x86 hardware.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list