From: Jiri Olsa <olsajiri@gmail.com>
To: Kuan-Ying Lee <kuan-ying.lee@canonical.com>
Cc: Kees Cook <kees@kernel.org>,
Andy Lutomirski <luto@amacapital.net>,
Will Drewry <wad@chromium.org>, Shuah Khan <shuah@kernel.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH] selftests/seccomp: Fix pointer type mismatch build error
Date: Wed, 15 Jul 2026 09:32:39 +0200 [thread overview]
Message-ID: <alc3lw0ubV96oaJK@krava> (raw)
In-Reply-To: <20260715053559.28535-1-kuan-ying.lee@canonical.com>
On Wed, Jul 15, 2026 at 01:35:52PM +0800, Kuan-Ying Lee wrote:
> We hit the following build error while running the seccomp selftests in
> our testing.
>
> CC seccomp_bpf
> seccomp_bpf.c: In function ‘UPROBE_setup’:
> seccomp_bpf.c:5175:74: error: pointer type mismatch in conditional expression [-Wincompatible-pointer-types]
> 5175 | offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
> | ^
> seccomp_bpf.c:5175:57: note: first expression has type ‘int (*)(void)’
> 5175 | offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
> | ^~~~~~~~~~~~~~~~
> seccomp_bpf.c:5175:76: note: second expression has type ‘int (__attribute__((nocf_check)) *)(void)’
> 5175 | offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
> | ^~~~~~~~~~~~~
>
> get_uprobe_offset() takes a 'const void *' argument, so cast both
> operands to 'void *'.
>
> Fixes: 9ffc7a635c35 ("selftests/seccomp: validate uprobe syscall passes through seccomp")
> Signed-off-by: Kuan-Ying Lee <kuan-ying.lee@canonical.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
thanks,
jirka
> ---
> 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 358b6c65e120..0622bc2acad4 100644
> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -5178,7 +5178,8 @@ FIXTURE_SETUP(UPROBE)
> ASSERT_GE(bit, 0);
> }
>
> - offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe);
> + offset = get_uprobe_offset(variant->uretprobe ? (void *)probed_uretprobe
> + : (void *)probed_uprobe);
> ASSERT_GE(offset, 0);
>
> if (variant->uretprobe)
> --
> 2.43.0
>
prev parent reply other threads:[~2026-07-15 7:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 5:35 [PATCH] selftests/seccomp: Fix pointer type mismatch build error Kuan-Ying Lee
2026-07-15 7:32 ` Jiri Olsa [this message]
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=alc3lw0ubV96oaJK@krava \
--to=olsajiri@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=kees@kernel.org \
--cc=kuan-ying.lee@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
--cc=wad@chromium.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.