[LTP] futex_wait06: Add EFAULT error coverage test
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Wed May 27 00:30:25 CEST 2026
Hi Michael,
On Wed, 27 May 2026 00:49:24 +0300, Michael Menasherov wrote:
> futex_wait06: Add EFAULT error coverage test
[...]
Patches 1-3 look good to me. One comment issue in patch 4 below.
--- [PATCH 4/4] ---
On Wed, 27 May 2026 00:49:27 +0300, Michael Menasherov wrote:
> futex_cmp_requeue03: Add EFAULT error coverage test
> +/*\
> + * Check that futex(FUTEX_CMP_REQUEUE) returns EFAULT when uaddr or
> + * uaddr2 points to unmapped memory, or when uaddr points to memory
> + * without read permission (PROT_NONE).
> + *
> + * get_futex_key() is called for both uaddr and uaddr2 before the
> + * *uaddr == val check; futex_var and val are both FUTEX_INITIALIZER.
> + */
The comment explains the key-ordering for the uaddr2 case but omits why
opflags=0 (no FUTEX_PRIVATE_FLAG) is required. With FUTEX_PRIVATE_FLAG,
get_futex_key(uaddr2) succeeds using a virtual-address key with no
physical page resolution, so the call returns 0 (no waiters) rather than
EFAULT for the "uaddr2 unmapped" and "uaddr PROT_NONE" cases. Please
add a note similar to the one in futex_wake05, e.g.:
The test uses opflags=0 (no FUTEX_PRIVATE_FLAG) so get_futex_key()
takes the shared-futex path and resolves the physical page; this
lookup fails with EFAULT for unmapped and PROT_NONE addresses.
The code itself (opflags=0 in the call) is correct; the comment just
needs to explain why.
---
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
More information about the ltp
mailing list