Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/2] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode
Date: Thu, 24 Sep 2026 13:03:53 +0200	[thread overview]
Message-ID: <20260924110353.GD2364284@pevik> (raw)
In-Reply-To: <arOz8kIcqqlWEdJ6@yuki.lan>

> Hi!
> > Reported-by: Wei Gao <wegao@suse.com>
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> > [ pvorel: separate into its own commit, write the commit message ]
> > Co-developed-by: Petr Vorel <pvorel@suse.cz>
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >  testcases/kernel/syscalls/shmctl/shmctl03.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)

> > diff --git a/testcases/kernel/syscalls/shmctl/shmctl03.c b/testcases/kernel/syscalls/shmctl/shmctl03.c
> > index 9e1c2f0990..0056f2c4b4 100644
> > --- a/testcases/kernel/syscalls/shmctl/shmctl03.c
> > +++ b/testcases/kernel/syscalls/shmctl/shmctl03.c
> > @@ -30,7 +30,11 @@ static void verify_ipcinfo(void)
> >  	else
> >  		tst_res(TPASS, "shmmin = 1");

> > -	TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
> > +	if (tst_is_compat_mode() && info.shmmax == INT_MAX)
> > +		tst_res(TPASS, "shmmax clamped to INT_MAX in compat mode");

> This should be turned into PATH_KERN_SHMMAX >= INT_MAX check instead of
> printing TPASS blindly.

Right, I'll send a patch which check:

	if (tst_is_compat_mode() && info.shmmax == INT_MAX) {
		unsigned long long shmmax;
		SAFE_FILE_SCANF(PATH_KERN_SHMMAX, "%llu", &shmmax);
		TST_EXP_LE_LU(INT_MAX, shmmax);
	} else {
		TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
	}

Kind regards,
Petr

> > +	else
> > +		TST_ASSERT_ULONG(PATH_KERN_SHMMAX, info.shmmax);
> > +
> >  	TST_ASSERT_ULONG(PATH_KERN_SHMMNI, info.shmmni);
> >  	TST_ASSERT_ULONG(PATH_KERN_SHMALL, info.shmall);
> >  }
> > -- 
> > 2.55.0

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

      reply	other threads:[~2026-09-24 11:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 12:50 [LTP] [PATCH 0/2] shmctl03 fix on 32bit compat mode Petr Vorel
2026-09-18 12:50 ` [LTP] [PATCH 1/2] tst_assert: Use 'long long' to fix 32bit compat mode truncation Petr Vorel
2026-09-18 17:06   ` [LTP] " linuxtestproject.agent
2026-09-22  7:35     ` Petr Vorel
2026-09-18 12:50 ` [LTP] [PATCH 2/2] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
2026-09-23 11:11   ` Cyril Hrubis
2026-09-24 11:03     ` Petr Vorel [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=20260924110353.GD2364284@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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