linux-stable/tools/testing
Sidhartha Kumar 18d609daa5 selftest/vm: verify remap destination address in mremap_test
Because mremap does not have a MAP_FIXED_NOREPLACE flag, it can destroy
existing mappings.  This causes a segfault when regions such as text are
remapped and the permissions are changed.

Verify the requested mremap destination address does not overlap any
existing mappings by using mmap's MAP_FIXED_NOREPLACE flag.  Keep
incrementing the destination address until a valid mapping is found or
fail the current test once the max address is reached.

Link: https://lkml.kernel.org/r/20220420215721.4868-2-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-04-21 20:01:10 -07:00
..
cxl tools/testing/cxl: Add a physical_node link 2022-02-08 22:57:33 -08:00
fault-injection
ktest
kunit linux-kselftest-kunit-5.18-rc1 2022-03-23 12:56:39 -07:00
memblock memblock tests: Add TODO and README files 2022-03-10 12:19:44 +02:00
nvdimm tools/testing/nvdimm: Fix security_init() symbol collision 2022-04-08 12:59:25 -07:00
radix-tree tools: Move gfp.h and slab.h from radix-tree to lib 2022-02-20 08:44:37 +02:00
scatterlist tools/testing/scatterlist: add missing defines 2022-01-30 09:56:58 +02:00
selftests selftest/vm: verify remap destination address in mremap_test 2022-04-21 20:01:10 -07:00
vsock af_vsock: SOCK_SEQPACKET broken buffer test 2022-03-18 15:13:19 +00:00