[LTP] Suggested fix for the mremap03 syscall testcase
Andrea Cervesato
andrea.cervesato@suse.com
Wed Oct 14 20:32:09 CEST 2026
Hi Martin,
you are right. That’s a bug we didn’t spot during the test rewrite. Thanks.
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
> On 14. Oct 2026, at 14:20, Martin Cermak via ltp <ltp@lists.linux.it> wrote:
>
> 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
> <0001-Fix-the-mremap03-syscall-testcase.patch>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
More information about the ltp
mailing list