Linux Test Project
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode
Date: Fri, 25 Sep 2026 11:21:28 +0000	[thread overview]
Message-ID: <20260925112128.4171-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260925082840.2408504-2-pvorel@suse.cz>

Hi Petr,

On Fri, 25 Sep 2026 10:28:39 +0200, Petr Vorel wrote:
> [PATCH 1/2] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode

--- [PATCH 1/2] ---

> +	SAFE_FILE_SCANF(PATH_KERN_SHMMAX, "%lu", &shmmax);
> +	if (tst_is_compat_mode() && info.shmmax == INT_MAX)
> +		TST_EXP_LE_LU(INT_MAX, shmmax);
> +	else
> +		TST_EXP_EQ_LU(info.shmmax, shmmax);

Testing `info.shmmax == INT_MAX` in the condition masks regressions; if the
kernel fails to clamp `info.shmmax`, execution takes the else branch and
reports TPASS. Additionally, `TST_EXP_LE_LU(INT_MAX, shmmax)` compares
`INT_MAX` against `shmmax` rather than verifying `info.shmmax`. Use
`unsigned long long` with `"%llu"` to avoid 32-bit overflow when reading
`PATH_KERN_SHMMAX`, and assert `info.shmmax` equals `INT_MAX` when
`tst_is_compat_mode() && shmmax > INT_MAX` (or `shmmax` otherwise).

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

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

  reply	other threads:[~2026-09-25 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  8:28 [LTP] [PATCH v3 0/2] shmctl03: Fix shmmax clamped to INT_MAX in 32bit compat mode Petr Vorel
2026-09-25  8:28 ` [LTP] [PATCH v3 1/2] " Petr Vorel
2026-09-25 11:21   ` linuxtestproject.agent [this message]
2026-09-25  8:28 ` [LTP] [PATCH v3 2/2] shmctl03: Use test macros Petr Vorel

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=20260925112128.4171-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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