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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7Q8m4131_7K44qn@kitsune.suse.cz>
Date: Tue, 18 Feb 2025 08:54:03 +0100
From: Michal Suchánek <msuchanek@...e.de>
To: Shung-Hsi Yu <shung-hsi.yu@...e.com>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	Michael Ellerman <mpe@...erman.id.au>,
	Madhavan Srinivasan <maddy@...ux.ibm.com>,
	Nicholas Piggin <npiggin@...il.com>,
	Christophe Leroy <christophe.leroy@...roup.eu>,
	Naveen N Rao <naveen@...nel.org>,
	Nathan Chancellor <nathan@...nel.org>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>,
	Segher Boessenkool <segher@...nel.crashing.org>,
	Vitaly Chikunov <vt@...linux.org>,
	Abhishek Dubey <dubeyabhishek777@...il.com>,
	Yonghong Song <yonghong.song@...ux.dev>
Subject: Re: [PATCH 1/1] powerpc: use __clang__ instead of CONFIG_CC_IS_CLANG

Hello,

how does this happen?

On Tue, Feb 18, 2025 at 12:48:01PM +0800, Shung-Hsi Yu wrote:
> Due to include chain (below), powerpc's asm-compat.h is part of UAPI,
> thus it should use the __clang__ macro to directly detect whether Clang
> is used rather then relying on the kernel config setting. The later is
> unreliable because the userspace tools that uses UAPI may be compile
> with a different compiler than the one used for the kernel, leading to
> incorrect constrain selection (see link for an example of such).
> 
>   include/uapi/linux/ptrace.h
>   arch/powerpc/include/asm/ptrace.h

There is arch/powerpc/include/uapi/asm/ptrace.h

and if the installed header is used this is what should be included.

That does no include other asm headers.

Thanks

Michal

>   arch/powerpc/include/asm/paca.h
>   arch/powerpc/include/asm/atomic.h
>   arch/powerpc/include/asm/asm-compat.h
> 
> Link: https://github.com/iovisor/bcc/issues/5172
> Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@...e.com>
> ---
>  arch/powerpc/include/asm/asm-compat.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h
> index f48e644900a2..34f8740909a9 100644
> --- a/arch/powerpc/include/asm/asm-compat.h
> +++ b/arch/powerpc/include/asm/asm-compat.h
> @@ -37,7 +37,7 @@
>  #define STDX_BE	stringify_in_c(stdbrx)
>  #endif
>  
> -#ifdef CONFIG_CC_IS_CLANG
> +#ifdef __clang__
>  #define DS_FORM_CONSTRAINT "Z<>"
>  #else
>  #define DS_FORM_CONSTRAINT "YZ<>"
> -- 
> 2.48.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ