public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] pidns32: fix PID namespace nesting depth off-by-one
Date: Mon, 30 Mar 2026 15:33:04 +0200	[thread overview]
Message-ID: <20260330133304.GA93779@pevik> (raw)
In-Reply-To: <20260330100750.858390-1-vasileios.almpanis@virtuozzo.com>

Hi Vasileios,

> The 2023 refactor used tst_atomic_inc() before clone with a zero-initial
> counter, which only performed 31 CLONE_NEWPID nests while still expecting
> MAXNEST (32). Compare the level to MAXNEST first, then increment and clone,
> so the shared counter runs 0..32 and the chain reaches 32 nested namespaces
> again.

Indeed, good catch.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> Fixes: 647cfd468c3b ("Refactor pidns32 test using new LTP API")
> Signed-off-by: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
> ---
>  testcases/kernel/containers/pidns/pidns32.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

> diff --git a/testcases/kernel/containers/pidns/pidns32.c b/testcases/kernel/containers/pidns/pidns32.c
> index fc9bf0aaa..3a272f569 100644
> --- a/testcases/kernel/containers/pidns/pidns32.c
> +++ b/testcases/kernel/containers/pidns/pidns32.c
> @@ -27,9 +27,11 @@ static pid_t child_func(void)
>  {
>  	pid_t cpid = 0;

> -	if (tst_atomic_inc(level) == MAXNEST)
> +	if (tst_atomic_load(level) == MAXNEST)
>  		return cpid;

> +	tst_atomic_inc(level);
> +
>  	cpid = SAFE_CLONE(&args);
>  	if (!cpid) {
>  		child_func();

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

  parent reply	other threads:[~2026-03-30 13:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 10:07 [LTP] [PATCH] pidns32: fix PID namespace nesting depth off-by-one Vasileios Almpanis via ltp
2026-03-30 10:23 ` Andrea Cervesato via ltp
2026-03-30 13:33 ` Petr Vorel [this message]
2026-03-30 14:42   ` Cyril Hrubis

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=20260330133304.GA93779@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=vasileios.almpanis@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