All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH vz10] selftests/prctl: skip anon VMA naming test when unsupported
@ 2026-08-21 15:05 Eva Kurchatova
  2026-08-24 12:27 ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko
  2026-08-24 12:28 ` [Devel] [PATCH vz10] " Konstantin Khorenko
  0 siblings, 2 replies; 3+ messages in thread
From: Eva Kurchatova @ 2026-08-21 15:05 UTC (permalink / raw)


PR_SET_VMA_ANON_NAME returns EINVAL on kernels built without
CONFIG_ANON_VMA_NAME, and every renaming test then fails.

https://virtuozzo.atlassian.net/browse/VSTOR-142442
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 .../testing/selftests/prctl/set-anon-vma-name-test.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/testing/selftests/prctl/set-anon-vma-name-test.c b/tools/testing/selftests/prctl/set-anon-vma-name-test.c
index 4275cb256dce..815470c47aff 100644
--- a/tools/testing/selftests/prctl/set-anon-vma-name-test.c
+++ b/tools/testing/selftests/prctl/set-anon-vma-name-test.c
@@ -76,6 +76,18 @@ FIXTURE(vma) {
 };
 
 FIXTURE_SETUP(vma) {
+	void *probe;
+	int res;
+
+	/* Naming anonymous VMAs needs CONFIG_ANON_VMA_NAME. */
+	probe = mmap(NULL, AREA_SIZE, PROT_READ | PROT_WRITE,
+					MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+	ASSERT_NE(probe, MAP_FAILED);
+	res = rename_vma((unsigned long)probe, AREA_SIZE, GOOD_NAME);
+	munmap(probe, AREA_SIZE);
+	if (res == -EINVAL)
+		SKIP(return, "CONFIG_ANON_VMA_NAME is not enabled");
+
 	self->ptr_anon = mmap(NULL, AREA_SIZE, PROT_READ | PROT_WRITE,
 					MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	ASSERT_NE(self->ptr_anon, NULL);
-- 
2.55.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-24 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-21 15:05 [Devel] [PATCH vz10] selftests/prctl: skip anon VMA naming test when unsupported Eva Kurchatova
2026-08-24 12:27 ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko
2026-08-24 12:28 ` [Devel] [PATCH vz10] " Konstantin Khorenko

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.