linux-stable/tools
Sidhartha Kumar a17404fcbf selftest/vm: verify mmap addr in mremap_test
[ Upstream commit 9c85a9bae2 ]

Avoid calling mmap with requested addresses that are less than the
system's mmap_min_addr.  When run as root, mmap returns EACCES when
trying to map addresses < mmap_min_addr.  This is not one of the error
codes for the condition to retry the mmap in the test.

Rather than arbitrarily retrying on EACCES, don't attempt an mmap until
addr > vm.mmap_min_addr.

Add a munmap call after an alignment check as the mappings are retained
after the retry and can reach the vm.max_map_count sysctl.

Link: https://lkml.kernel.org/r/20220420215721.4868-1-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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-09 09:14:40 +02:00
..
accounting
arch x86/tsx: Disable TSX development mode at boot 2022-04-20 09:34:20 +02:00
bootconfig tools/bootconfig: Define memblock_free_ptr() to fix build error 2021-09-15 09:49:48 -07:00
bpf bpftool: Fix the error when lookup in no-btf maps 2022-04-08 14:23:31 +02:00
build tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts 2022-04-13 20:59:26 +02:00
cgroup
debugging
edid
firewire
firmware
gpio
hv
iio
include bpf: Fix comment for helper bpf_current_task_under_cgroup() 2022-04-08 14:24:14 +02:00
io_uring
kvm/kvm_stat KVM: kvm_stat: do not show halt_wait_ns 2021-10-18 14:07:18 -04:00
laptop
leds
lib perf tools: Fix segfault accessing sample_id xyarray 2022-04-27 14:38:50 +02:00
memory-model
objtool objtool: Handle __sanitize_cov*() tail calls 2021-11-18 19:16:23 +01:00
pci
pcmcia
perf perf arm-spe: Fix addresses of synthesized SPE events 2022-05-09 09:14:39 +02:00
power
rcu
scripts
spi
testing selftest/vm: verify mmap addr in mremap_test 2022-05-09 09:14:40 +02:00
thermal/tmon
time
tracing tools/latency-collector: Use correct size when writing queue_full_warning 2021-11-18 19:16:19 +01:00
usb usb: testusb: Fix for showing the connection speed 2021-09-14 10:31:41 +02:00
virtio tools/virtio: fix virtio_test execution 2022-04-08 14:22:47 +02:00
vm tools/vm/page-types: remove dependency on opt_file for idle page tracking 2021-09-24 16:13:35 -07:00
wmi
Makefile