[LTP] [PATCH v2] ioctl_pidfd02.c: fix clone3 EFAULT in 32-bit compat mode due to sign extension

Cyril Hrubis chrubis@suse.cz
Fri Feb 13 10:27:48 CET 2026


Hi!
> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  include/tst_common.h                            | 5 +++++
>  testcases/kernel/syscalls/ioctl/ioctl_pidfd02.c | 2 +-
>  testcases/kernel/syscalls/ioctl/ioctl_pidfd03.c | 2 +-
>  testcases/kernel/syscalls/ioctl/ioctl_pidfd04.c | 2 +-
>  testcases/kernel/syscalls/ioctl/ioctl_pidfd05.c | 2 +-
>  testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c | 2 +-
>  6 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/include/tst_common.h b/include/tst_common.h
> index 473228149..430c5e171 100644
> --- a/include/tst_common.h
> +++ b/include/tst_common.h
> @@ -86,4 +86,9 @@
>  #define TST_TO_STR_(s) #s
>  #define TST_TO_STR(s) TST_TO_STR_(s)
>  
> +/*
> + * TST_PTR_TO_UINT - Casts a pointer to a 64-bit unsigned integer.
> + */
> +#define TST_PTR_TO_UINT(x) ((uint64_t)(uintptr_t)(x))

There is no need to have the (uint64_t) cast here, the uintptr_t cast is
enough to fix the problem.


Other than that:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list