* [LTP] [PATCH 0/2] Regression test for 49ccf2c3cafb
@ 2026-07-15 11:39 Andrea Cervesato
2026-07-15 11:39 ` [LTP] [PATCH 1/2] lapi: add PROT_MTE fallback Andrea Cervesato
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Andrea Cervesato @ 2026-07-15 11:39 UTC (permalink / raw)
To: Linux Test Project
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
Andrea Cervesato (2):
lapi: add PROT_MTE fallback
hugemmap35: add regression test for 49ccf2c3cafb
include/lapi/mman.h | 4 +
runtest/hugetlb | 1 +
testcases/kernel/mem/.gitignore | 1 +
testcases/kernel/mem/hugetlb/hugemmap/hugemmap35.c | 105 +++++++++++++++++++++
4 files changed, 111 insertions(+)
---
base-commit: d139524b04d360c4dabaee61a6066a9a52b0e454
change-id: 20260715-hugemmap35-fdc484ee4bbf
Best regards,
--
Andrea Cervesato <andrea.cervesato@suse.com>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 1/2] lapi: add PROT_MTE fallback
2026-07-15 11:39 [LTP] [PATCH 0/2] Regression test for 49ccf2c3cafb Andrea Cervesato
@ 2026-07-15 11:39 ` Andrea Cervesato
2026-07-15 12:21 ` [LTP] " linuxtestproject.agent
2026-07-15 11:39 ` [LTP] [PATCH 2/2] hugemmap35: add regression test for 49ccf2c3cafb Andrea Cervesato
2026-07-15 15:47 ` [LTP] [PATCH 0/2] Regression " Andrea Cervesato via ltp
2 siblings, 1 reply; 6+ messages in thread
From: Andrea Cervesato @ 2026-07-15 11:39 UTC (permalink / raw)
To: Linux Test Project
From: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
include/lapi/mman.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/lapi/mman.h b/include/lapi/mman.h
index edd517c6e0ebad98f01530b9ac2a7c90cdcaced8..ca72ffd484129b9e8c9165816544da0d8d0ea06a 100644
--- a/include/lapi/mman.h
+++ b/include/lapi/mman.h
@@ -11,6 +11,10 @@
#include "config.h"
#include "lapi/syscalls.h"
+#ifndef PROT_MTE
+# define PROT_MTE 0x20
+#endif
+
#ifndef HAVE_STRUCT_CACHESTAT_RANGE
struct cachestat_range {
uint64_t off;
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/2] hugemmap35: add regression test for 49ccf2c3cafb
2026-07-15 11:39 [LTP] [PATCH 0/2] Regression test for 49ccf2c3cafb Andrea Cervesato
2026-07-15 11:39 ` [LTP] [PATCH 1/2] lapi: add PROT_MTE fallback Andrea Cervesato
@ 2026-07-15 11:39 ` Andrea Cervesato
2026-07-15 13:02 ` Cyril Hrubis
2026-07-15 15:47 ` [LTP] [PATCH 0/2] Regression " Andrea Cervesato via ltp
2 siblings, 1 reply; 6+ messages in thread
From: Andrea Cervesato @ 2026-07-15 11:39 UTC (permalink / raw)
To: Linux Test Project
From: Andrea Cervesato <andrea.cervesato@suse.com>
Add a regression test verifying that a hugetlbfs file can be mapped
with PROT_MTE even when MAP_HUGETLB is not set in the mmap() flags.
Before the referenced commit, VM_MTE_ALLOWED was not set early enough
for hugetlbfs file mappings, so such an mmap() was wrongly rejected.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
runtest/hugetlb | 1 +
testcases/kernel/mem/.gitignore | 1 +
testcases/kernel/mem/hugetlb/hugemmap/hugemmap35.c | 105 +++++++++++++++++++++
3 files changed, 107 insertions(+)
diff --git a/runtest/hugetlb b/runtest/hugetlb
index 0896d3c941f068628f53c31197b293906c4ecba6..8ee0e6f828cb1954e03d67d40fe691d6521361bf 100644
--- a/runtest/hugetlb
+++ b/runtest/hugetlb
@@ -36,6 +36,7 @@ hugemmap30 hugemmap30
hugemmap31 hugemmap31
hugemmap32 hugemmap32
hugemmap34 hugemmap34
+hugemmap35 hugemmap35
hugemmap05_1 hugemmap05 -m
hugemmap05_2 hugemmap05 -s
hugemmap05_3 hugemmap05 -s -m
diff --git a/testcases/kernel/mem/.gitignore b/testcases/kernel/mem/.gitignore
index b4455de51d6d6a9cc3d8b7ff392fc3ea9e95890a..0e59035dfdcf759aa16c069575bb1f4eb58f321c 100644
--- a/testcases/kernel/mem/.gitignore
+++ b/testcases/kernel/mem/.gitignore
@@ -36,6 +36,7 @@
/hugetlb/hugemmap/hugemmap31
/hugetlb/hugemmap/hugemmap32
/hugetlb/hugemmap/hugemmap34
+/hugetlb/hugemmap/hugemmap35
/hugetlb/hugeshmat/hugeshmat01
/hugetlb/hugeshmat/hugeshmat02
/hugetlb/hugeshmat/hugeshmat03
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap35.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap35.c
new file mode 100644
index 0000000000000000000000000000000000000000..1c11013e0de6b6dd870e3ffc48562912a44cf7f7
--- /dev/null
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap35.c
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
+ */
+
+/*\
+ * Test that :manpage:`mmap(2)` accepts ``PROT_MTE`` for hugetlbfs file
+ * mappings that do not specify ``MAP_HUGETLB``.
+ *
+ * On arm64, hugetlbfs file mappings must get ``VM_MTE_ALLOWED`` before mmap
+ * flag validation. This is needed because mapping a hugetlbfs file does not
+ * have to use ``MAP_HUGETLB``. The test needs root to reserve huge pages and
+ * mount hugetlbfs.
+ */
+
+#define _GNU_SOURCE
+
+#include "tst_test.h"
+#include "hugetlb.h"
+#include "lapi/mman.h"
+#include "lapi/mmap.h"
+
+#define MNTPOINT "hugetlbfs/"
+
+static int fd = -1;
+static long hpage_size;
+
+#define TC(x) {x, #x}
+
+static struct tcase {
+ int flags;
+ const char *desc;
+} tcases[] = {
+ TC(MAP_SHARED),
+ TC(MAP_PRIVATE),
+};
+
+static void run(unsigned int n)
+{
+ struct tcase *tc = &tcases[n];
+ volatile char *ptr;
+
+ TESTPTR(mmap(NULL, hpage_size, PROT_READ | PROT_WRITE | PROT_MTE,
+ tc->flags, fd, 0));
+
+ if (TST_RET_PTR == MAP_FAILED) {
+ if (TST_ERR == ENOMEM)
+ tst_brk(TCONF, "Not enough huge pages");
+
+ tst_res(TFAIL | TTERRNO, "mmap(PROT_MTE, %s) without MAP_HUGETLB failed",
+ tc->desc);
+ return;
+ }
+
+ ptr = TST_RET_PTR;
+ *ptr = 1;
+
+ SAFE_MUNMAP(TST_RET_PTR, hpage_size);
+
+ tst_res(TPASS, "mmap(PROT_MTE, %s) without MAP_HUGETLB passed", tc->desc);
+}
+
+static void setup(void)
+{
+ hpage_size = tst_get_hugepage_size();
+ if (!hpage_size)
+ tst_brk(TCONF, "Huge pages are not supported");
+
+ TESTPTR(mmap(NULL, hpage_size, PROT_READ | PROT_MTE,
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0));
+
+ if (TST_RET_PTR == MAP_FAILED)
+ tst_brk(TCONF | TTERRNO, "PROT_MTE is not supported with MAP_HUGETLB");
+
+ SAFE_MUNMAP(TST_RET_PTR, hpage_size);
+
+ fd = tst_creat_unlinked(MNTPOINT, 0, 0600);
+ SAFE_FTRUNCATE(fd, hpage_size);
+}
+
+static void cleanup(void)
+{
+ if (fd != -1)
+ SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+ .test = run,
+ .setup = setup,
+ .cleanup = cleanup,
+ .tcnt = ARRAY_SIZE(tcases),
+ .needs_root = 1,
+ .needs_tmpdir = 1,
+ .mntpoint = MNTPOINT,
+ .needs_hugetlbfs = 1,
+ .hugepages = { 2, TST_NEEDS },
+ .supported_archs = (const char *const []) {
+ "aarch64",
+ NULL
+ },
+ .tags = (const struct tst_tag[]) {
+ {"linux-git", "49ccf2c3cafb"},
+ {}
+ },
+};
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] lapi: add PROT_MTE fallback
2026-07-15 11:39 ` [LTP] [PATCH 1/2] lapi: add PROT_MTE fallback Andrea Cervesato
@ 2026-07-15 12:21 ` linuxtestproject.agent
0 siblings, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-07-15 12:21 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Hi Andrea,
On Wed, 15 Jul 2026, Andrea Cervesato wrote:
> lapi: add PROT_MTE fallback
Verdict - Reviewed
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 2/2] hugemmap35: add regression test for 49ccf2c3cafb
2026-07-15 11:39 ` [LTP] [PATCH 2/2] hugemmap35: add regression test for 49ccf2c3cafb Andrea Cervesato
@ 2026-07-15 13:02 ` Cyril Hrubis
0 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2026-07-15 13:02 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: Linux Test Project
Hi!
For the patchset:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 0/2] Regression test for 49ccf2c3cafb
2026-07-15 11:39 [LTP] [PATCH 0/2] Regression test for 49ccf2c3cafb Andrea Cervesato
2026-07-15 11:39 ` [LTP] [PATCH 1/2] lapi: add PROT_MTE fallback Andrea Cervesato
2026-07-15 11:39 ` [LTP] [PATCH 2/2] hugemmap35: add regression test for 49ccf2c3cafb Andrea Cervesato
@ 2026-07-15 15:47 ` Andrea Cervesato via ltp
2 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-07-15 15:47 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: Linux Test Project
Merged, Thanks!
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-15 15:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 11:39 [LTP] [PATCH 0/2] Regression test for 49ccf2c3cafb Andrea Cervesato
2026-07-15 11:39 ` [LTP] [PATCH 1/2] lapi: add PROT_MTE fallback Andrea Cervesato
2026-07-15 12:21 ` [LTP] " linuxtestproject.agent
2026-07-15 11:39 ` [LTP] [PATCH 2/2] hugemmap35: add regression test for 49ccf2c3cafb Andrea Cervesato
2026-07-15 13:02 ` Cyril Hrubis
2026-07-15 15:47 ` [LTP] [PATCH 0/2] Regression " Andrea Cervesato via ltp
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.