android_kernel_motorola_sm6375/tools
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mike Kravetz ad66df9064 selftests/memfd: clean up mapping in mfd_fail_write
[ Upstream commit fda153c89af344d21df281009a9d046cf587ea0f ]

Running the memfd script ./run_hugetlbfs_test.sh will often end in error
as follows:

    memfd-hugetlb: CREATE
    memfd-hugetlb: BASIC
    memfd-hugetlb: SEAL-WRITE
    memfd-hugetlb: SEAL-FUTURE-WRITE
    memfd-hugetlb: SEAL-SHRINK
    fallocate(ALLOC) failed: No space left on device
    ./run_hugetlbfs_test.sh: line 60: 166855 Aborted                 (core dumped) ./memfd_test hugetlbfs
    opening: ./mnt/memfd
    fuse: DONE

If no hugetlb pages have been preallocated, run_hugetlbfs_test.sh will
allocate 'just enough' pages to run the test.  In the SEAL-FUTURE-WRITE
test the mfd_fail_write routine maps the file, but does not unmap.  As a
result, two hugetlb pages remain reserved for the mapping.  When the
fallocate call in the SEAL-SHRINK test attempts allocate all hugetlb
pages, it is short by the two reserved pages.

Fix by making sure to unmap in mfd_fail_write.

Link: https://lkml.kernel.org/r/20220219004340.56478-1-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Shuah Khan <shuah@kernel.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-03-16 13:21:47 +01:00
..
accounting
arch x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE 2022-03-11 11:22:37 +01:00
bpf bpftool: Remove inclusion of utilities.mak from Makefiles 2022-01-27 09:19:53 +01:00
build tools build: Remove needless libpython-version feature check that breaks test-all fast path 2021-12-14 14:49:03 +01:00
cgroup
debugging
firewire
firmware
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-10-01 13:17:47 +02:00
hv
iio
include tools/nolibc: fix incorrect truncation of exit code 2022-01-27 09:19:27 +01:00
io_uring tools/io_uring: fix compile breakage 2020-10-07 08:01:27 +02:00
kvm/kvm_stat
laptop
leds
lib libsubcmd: Fix use-after-free for realloc(..., 0) 2022-02-23 11:59:58 +01:00
memory-model
nfsd
objtool objtool: Fix ".cold" section suffix check for newer versions of GCC 2021-03-04 10:26:30 +01:00
pci
pcmcia
perf perf data: Fix double free in perf_session__delete() 2022-03-02 11:41:05 +01:00
power tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
scripts tools: Allow proper CC/CXX/... override with LLVM=1 in Makefile.include 2021-07-31 08:19:37 +02:00
spi
testing selftests/memfd: clean up mapping in mfd_fail_write 2022-03-16 13:21:47 +01:00
thermal/tmon tools/thermal/tmon: Add cross compiling support 2021-09-22 12:26:20 +02:00
time
usb usb: testusb: Fix for showing the connection speed 2021-10-09 14:39:49 +02:00
virtio
vm tools/vm/page-types: remove dependency on opt_file for idle page tracking 2021-10-09 14:39:50 +02:00
wmi
Makefile