Hi Wei,
On Aug 19, 2026, Wei Gao wrote:
> shmctl03: Fix 32-bit compat mode failure by adjusting comparisons for compat mode truncation
> +#define TST_ASSERT_SATURATED_INT 0x01
> +#define TST_ASSERT_BITWISE 0x02
> +
> /*
> * Same as tst_assert_int() but for unsigned long.
> */
> void tst_assert_ulong(const char *file, const int lineno,
> + const char *path, unsigned long val, int flags);
Could these new public flags and the flags parameter be documented with
kernel-doc? The existing comment does not explain that one mode clamps at
INT_MAX while the other keeps the low 32 bits. [Low]
> + /*
> + * On 64-bit kernel, shmmax is clamped to INT_MAX for 32-bit
> + * compat syscall, while shmmni and shmall are truncated
> + * to 32-bit.
> + */
> + TST_ASSERT_ULONG(PATH_KERN_SHMMNI, info.shmmni, TST_ASSERT_BITWISE);
Could shmmni keep the direct comparison, and could the comment omit it?
In Linux 7.2, ipc_namespace.shm_ctlmni is an int, the sysctl limits it to
0..ipc_mni, and the compat path copies it directly to compat_ulong_t, so no
truncation occurs. [Low]
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.