From: Sasha Levin <sashal@kernel.org>
To: Shuah Khan <shuah@kernel.org>
Cc: Sasha Levin <sashal@kernel.org>,
Ivan Orlov <ivan.orlov0322@gmail.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] selftests/prctl: skip the anonymous VMA naming test when unsupported
Date: Wed, 14 Oct 2026 16:01:24 -0400 [thread overview]
Message-ID: <20261014200127.1363472-3-sashal@kernel.org> (raw)
In-Reply-To: <20261014200127.1363472-1-sashal@kernel.org>
PR_SET_VMA_ANON_NAME is only implemented when CONFIG_ANON_VMA_NAME is
enabled. Without it, set_anon_vma_name() returns -EINVAL for every
request, so set-anon-vma-name-test reports a failure on kernels that
simply do not provide the feature:
# renaming: Expected rename_vma(...) (-22) >= 0
not ok 1 vma.renaming
Probe the interface in the fixture setup by clearing the name of the
anonymous mapping, which succeeds whenever the feature is available,
and skip the test when the kernel rejects the request with EINVAL.
Fixes: 5290586186d2 ("selftests: prctl: Add new prctl test for PR_SET_VMA action")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/prctl/set-anon-vma-name-test.c | 3 +++
1 file changed, 3 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 5f9589534da8e..d3854ccb2a7a3 100644
--- a/tools/testing/selftests/prctl/set-anon-vma-name-test.c
+++ b/tools/testing/selftests/prctl/set-anon-vma-name-test.c
@@ -93,6 +93,9 @@ FIXTURE_SETUP(vma) {
MAP_PRIVATE, self->fd_not_anon, 0);
ASSERT_NE(self->ptr_not_anon, MAP_FAILED);
close(self->fd_not_anon);
+
+ if (rename_vma((unsigned long)self->ptr_anon, AREA_SIZE, NULL) == -EINVAL)
+ SKIP(return, "PR_SET_VMA_ANON_NAME is not supported");
}
FIXTURE_TEARDOWN(vma) {
--
2.53.0
next prev parent reply other threads:[~2026-10-14 20:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
2026-10-14 20:01 ` [PATCH 1/5] selftests/prctl: build generated tests for the target architecture Sasha Levin
2026-10-14 20:01 ` Sasha Levin [this message]
2026-10-14 20:01 ` [PATCH 3/5] selftests/thermal: allow cross builds of the Intel tests Sasha Levin
2026-10-14 20:01 ` [PATCH 4/5] selftests/kexec: select tests using the target compiler Sasha Levin
2026-10-14 20:01 ` [PATCH 5/5] selftests/size: use nolibc startup and syscall wrappers Sasha Levin
2026-10-14 20:51 ` Thomas Weißschuh
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=20261014200127.1363472-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=ivan.orlov0322@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
/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