OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: Re: [Devel] [PATCH vz10] selftests/prctl: skip anon VMA naming test when unsupported
Date: Mon, 24 Aug 2026 14:28:06 +0200	[thread overview]
Message-ID: <9ea77c8d-0d52-4902-b092-033999271d85@virtuozzo.com> (raw)
In-Reply-To: <20260821150523.792660-1-eva.kurchatova@virtuozzo.com>

1. ack the patch

2. do not forget to remove the kludge in hci-kselftests:
  # prctl set-anon-vma-name-test test fails because CONFIG_ANON_VMA_NAME
  # is not enabled
  'prctl': ['set-anon-vma-name-test'],

3. There are 2 more bugs nearby, please fix them and send to ms as well:

In tools/testing/selftests/prctl/set-anon-vma-name-test.c,
FIXTURE_SETUP(vma) checks both mmap() results against NULL, but mmap() fails with MAP_FAILED, so neither ASSERT_NE() can ever fire.

        ASSERT_NE(self->ptr_anon, NULL);
        ASSERT_NE(self->ptr_not_anon, NULL);

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 8/21/26 17:05, Eva Kurchatova wrote:
> 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);


      parent reply	other threads:[~2026-08-24 12:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 15:05 Eva Kurchatova
2026-08-24 12:27 ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko
2026-08-24 12:28 ` Konstantin Khorenko [this message]

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=9ea77c8d-0d52-4902-b092-033999271d85@virtuozzo.com \
    --to=khorenko@virtuozzo.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