diff options
| author | Sidhartha Kumar <[email protected]> | 2022-04-21 23:35:52 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2022-04-22 03:01:10 +0000 |
| commit | 18d609daa546c919fd36b62a7b510c18de4b4af8 (patch) | |
| tree | d76cd1b8ae8a66653554e9b1b82e001e5d49eadd /lib/xarray.c | |
| parent | selftest/vm: verify mmap addr in mremap_test (diff) | |
| download | kernel-18d609daa546c919fd36b62a7b510c18de4b4af8.tar.gz kernel-18d609daa546c919fd36b62a7b510c18de4b4af8.zip | |
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/[email protected]
Signed-off-by: Sidhartha Kumar <[email protected]>
Reviewed-by: Shuah Khan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/xarray.c')
0 files changed, 0 insertions, 0 deletions
