All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Cermak via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it, valgrind-developers@lists.sourceforge.net,
	 Mark Wielaard <mark@klomp.org>
Subject: [LTP] Suggested fix for the mremap03 syscall testcase
Date: Wed, 14 Oct 2026 14:20:38 +0200	[thread overview]
Message-ID: <as9x2R-9IQb7vjn7@toolbx> (raw)

[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]

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

[-- Attachment #2: 0001-Fix-the-mremap03-syscall-testcase.patch --]
[-- Type: text/plain, Size: 1239 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2026-10-14 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 12:20 Martin Cermak via ltp [this message]
2026-10-14 16:42 ` [LTP] Fix the mremap03 syscall testcase linuxtestproject.agent
2026-10-14 18:32 ` [LTP] Suggested fix for " Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=as9x2R-9IQb7vjn7@toolbx \
    --to=ltp@lists.linux.it \
    --cc=mark@klomp.org \
    --cc=mcermak@redhat.com \
    --cc=valgrind-developers@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.