public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] mseal02: Handle multiple errnos for 32-bit compat mode
Date: Thu, 26 Feb 2026 02:25:25 +0000	[thread overview]
Message-ID: <20260226022536.20175-1-wegao@suse.com> (raw)
In-Reply-To: <20260128002828.424-1-wegao@suse.com>

In 32-bit compat mode, the overflow_size (calculated using a 32-bit ULONG_MAX)
does not cause a 64-bit integer wrap-around when added to the start address.
Consequently, the kernel see valid range that points to unmapped space, returning
ENOMEM instead of the expected EINVAL.

Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/syscalls/mseal/mseal02.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/syscalls/mseal/mseal02.c b/testcases/kernel/syscalls/mseal/mseal02.c
index e11d7dbf4..7e0172bc3 100644
--- a/testcases/kernel/syscalls/mseal/mseal02.c
+++ b/testcases/kernel/syscalls/mseal/mseal02.c
@@ -58,6 +58,9 @@ static void setup(void)
 	SAFE_MUNMAP(start_addr + twopages_size, page_size);
 	unallocated_start_addr = start_addr + twopages_size;
 	unallocated_end_addr = start_addr + page_size;
+
+	if (tst_is_compat_mode())
+		tcases[2].exp_err = ENOMEM;
 }
 
 static void cleanup(void)
-- 
2.52.0


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

  parent reply	other threads:[~2026-02-26  2:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28  0:28 [LTP] [PATCH v1] mseal02: Handle multiple errnos for 32-bit compat mode Wei Gao via ltp
2026-02-18 13:34 ` Andrea Cervesato via ltp
2026-02-19 11:37   ` Cyril Hrubis
2026-02-26  2:25 ` Wei Gao via ltp [this message]
2026-03-20 14:35   ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
2026-03-20 15:09   ` Petr Vorel
2026-03-20 17:27     ` Petr Vorel
2026-03-23  6:08   ` [LTP] [PATCH v3] " Wei Gao via ltp
2026-03-23 13:14     ` Cyril Hrubis
2026-03-26 10:07     ` Andrea Cervesato via ltp
2026-03-26 10:08     ` Andrea Cervesato via ltp
2026-03-26 10:43     ` Petr Vorel

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=20260226022536.20175-1-wegao@suse.com \
    --to=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox