The patch titled Subject: selftest/vm: test that mremap fails on non-existent vma has been added to the -mm tree. Its filename is selftest-vm-test-that-mremap-fails-on-non-existent-vma.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/selftest-vm-test-that-mremap-fails-on-non-existent-vma.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/selftest-vm-test-that-mremap-fails-on-non-existent-vma.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Niels Dossche <dossche.niels@xxxxxxxxx> Subject: selftest/vm: test that mremap fails on non-existent vma Add a regression test that validates that mremap fails for vma's that don't exist. Link: https://lkml.kernel.org/r/20220427224439.23828-3-dossche.niels@xxxxxxxxx Signed-off-by: Niels Dossche <dossche.niels@xxxxxxxxx> Cc: Mina Almasry <almasrymina@xxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/vm/hugepage-mremap.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/tools/testing/selftests/vm/hugepage-mremap.c~selftest-vm-test-that-mremap-fails-on-non-existent-vma +++ a/tools/testing/selftests/vm/hugepage-mremap.c @@ -178,6 +178,12 @@ int main(int argc, char *argv[]) munmap(addr, length); + addr = mremap(addr, length, length, 0); + if (addr != MAP_FAILED) { + printf("mremap: Expected failure, but call succeeded\n"); + exit(1); + } + close(fd); unlink(argv[argc-1]); _ Patches currently in -mm which might be from dossche.niels@xxxxxxxxx are mm-mremap-fix-sign-for-efault-error-return-value.patch selftest-vm-test-that-mremap-fails-on-non-existent-vma.patch