[LTP] [PATCH 2/2] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode
Cyril Hrubis
chrubis@suse.cz
Wed Sep 23 13:11:46 CEST 2026
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.
> + 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
>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list