lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87v7k2gcwt.fsf@gentoo.org>
Date: Sun, 26 Oct 2025 10:44:50 +0000
From: Sam James <sam@...too.org>
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>,  Nathan
 Chancellor <nathan@...nel.org>,  Nick Desaulniers
 <nick.desaulniers+lkml@...il.com>,  Bill Wendling <morbo@...gle.com>,
  Justin Stitt <justinstitt@...gle.com>,  linux-kselftest@...r.kernel.org,
  linux-kernel@...r.kernel.org,  bpf@...r.kernel.org,
  llvm@...ts.linux.dev,  khalid@...nel.org,  david.hunter.linux@...il.com,
  linux-kernel-mentees@...ts.linuxfoundation.org,  Jiri Olsa
 <olsajiri@...il.com>
Subject: Re: [PATCH v2] selftests/seccomp: fix pointer type mismatch in
 UPROBE test

Nirbhay Sharma <nirbhay.lkd@...il.com> writes:

> Fix compilation error in UPROBE_setup caused by pointer type mismatch
> in the ternary expression when compiled with -fcf-protection. The
> probed_uprobe function pointer has the __attribute__((nocf_check))
> attribute, which causes the conditional operator to fail when combined
> with the regular probed_uretprobe function pointer:
>

Just as a curiosity to share: I found a few tangential issues and
reported them as https://gcc.gnu.org/PR122427.

>   seccomp_bpf.c:5175:74: error: pointer type mismatch in conditional
>   expression [-Wincompatible-pointer-types]
>
> 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.
>
> This error appears with compilers that enable Control Flow Integrity
> (CFI) protection via -fcf-protection, such as Clang 19.1.2 (default
> on Fedora).
>

Reviewed-by: Sam James <sam@...too.org>

> 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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ