[LTP] Suggested fix for the mremap03 syscall testcase
Martin Cermak
mcermak@redhat.com
Wed Oct 14 14:20:38 CEST 2026
Hello folks,
I suspect that LTP commit 88cfde5fbc14b23f673b81855127448a519679c0
introduced a regression it the mremap03 testcase. I've originally
reported it as a Valgrind bug:
https://bugs.kde.org/show_bug.cgi?id=526974
But now I think it's an LTP bug. Proposed fix:
$ cat 0001-Fix-the-mremap03-syscall-testcase.patch
>From 3ddcfa8c303feeb8681632e458d71001fbfb825c Mon Sep 17 00:00:00 2001
From: Martin Cermak <mcermak@redhat.com>
Date: Wed, 14 Oct 2026 14:07:45 +0200
Subject: [PATCH] Fix the mremap03 syscall testcase
Commit 88cfde5fbc14b23f673b81855127448a519679c0 introduced a regression
in the setup() function of the mremap03 testcase. The goal is to pass
a bad_addr to the mremap() syscall.
The original version of the setup() function did generate the bad_addr
using tst_get_bad_addr(). This gives a mapped address which is not
accessible (PROT_NONE). The new version of the test does the same, but
unmaps that address right after that. Valgrind flags that as an error.
This patch restores the original behavior of the setup() funcrion.
---
testcases/kernel/syscalls/mremap/mremap03.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
index 4e647cdca..6003657d4 100644
--- a/testcases/kernel/syscalls/mremap/mremap03.c
+++ b/testcases/kernel/syscalls/mremap/mremap03.c
@@ -35,7 +35,6 @@ static void setup(void)
newsize = 2 * memsize;
bad_addr = tst_get_bad_addr(NULL);
- SAFE_MUNMAP(bad_addr, page_size);
}
static void run(void)
--
2.55.0
$
Thanks,
Martin
-------------- next part --------------
>From 3ddcfa8c303feeb8681632e458d71001fbfb825c Mon Sep 17 00:00:00 2001
From: Martin Cermak <mcermak@redhat.com>
Date: Wed, 14 Oct 2026 14:07:45 +0200
Subject: [PATCH] Fix the mremap03 syscall testcase
Commit 88cfde5fbc14b23f673b81855127448a519679c0 introduced a regression
in the setup() function of the mremap03 testcase. The goal is to pass
a bad_addr to the mremap() syscall.
The original version of the setup() function did generate the bad_addr
using tst_get_bad_addr(). This gives a mapped address which is not
accessible (PROT_NONE). The new version of the test does the same, but
unmaps that address right after that. Valgrind flags that as an error.
This patch restores the original behavior of the setup() funcrion.
---
testcases/kernel/syscalls/mremap/mremap03.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
index 4e647cdca..6003657d4 100644
--- a/testcases/kernel/syscalls/mremap/mremap03.c
+++ b/testcases/kernel/syscalls/mremap/mremap03.c
@@ -35,7 +35,6 @@ static void setup(void)
newsize = 2 * memsize;
bad_addr = tst_get_bad_addr(NULL);
- SAFE_MUNMAP(bad_addr, page_size);
}
static void run(void)
--
2.55.0
More information about the ltp
mailing list