[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aP0-k3vlEEWNUtF8@krava>
Date: Sat, 25 Oct 2025 23:18:11 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: Nirbhay Sharma <nirbhay.lkd@...il.com>
Cc: Kees Cook <kees@...nel.org>, Shuah Khan <shuah@...nel.org>,
Andy Lutomirski <luto@...capital.net>,
Will Drewry <wad@...omium.org>, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
khalid@...nel.org, david.hunter.linux@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH] selftests/seccomp: fix pointer type mismatch in UPROBE
test
On Sun, Oct 26, 2025 at 12:19:04AM +0530, Nirbhay Sharma wrote:
> Fix compilation error in UPROBE_setup caused by pointer type mismatch
> in ternary expression. The probed_uretprobe and probed_uprobe function
> pointers have different type attributes (__attribute__((nocf_check))),
just probed_uprobe right?
> which causes the conditional operator to fail with:
>
> seccomp_bpf.c:5175:74: error: pointer type mismatch in conditional
> expression [-Wincompatible-pointer-types]
curious what compiler do you see that with? gcc-15 is silent,
the change looks good to me
thanks,
jirka
>
> Cast both function pointers to 'const void *' to match the expected
> parameter type of get_uprobe_offset(), resolving the type mismatch
> while preserving the function selection logic.
>
> Signed-off-by: Nirbhay Sharma <nirbhay.lkd@...il.com>
> ---
> tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> index 874f17763536..e13ffe18ef95 100644
> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -5172,7 +5172,8 @@ FIXTURE_SETUP(UPROBE)
> ASSERT_GE(bit, 0);
> }
>
> - offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
> + offset = get_uprobe_offset(variant->uretprobe ?
> + (const void *)probed_uretprobe : (const void *)probed_uprobe);
> ASSERT_GE(offset, 0);
>
> if (variant->uretprobe)
> --
> 2.48.1
>
>
Powered by blists - more mailing lists