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: <f51557ff-412b-46e4-b968-78b4e4d9872d@kernel.org>
Date: Sat, 3 Jan 2026 11:39:12 +0100
From: "Christophe Leroy (CS GROUP)" <chleroy@...nel.org>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
 Madhavan Srinivasan <maddy@...ux.ibm.com>,
 Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc: Implement ARCH_HAS_CC_CAN_LINK



Le 30/12/2025 à 08:06, Thomas Weißschuh a écrit :
> The generic CC_CAN_LINK detection does not handle different byte orders.
> This may lead to userprogs which are not actually runnable on the target
> kernel.

Isn't the kernel supposed to handle any userland endianess ? Macro 
SET_ENDIAN() is there for that as far as I understand.

And if you want to be complete, I think you should also check whether 
the ELF ABI is v1 or v2.

Christophe

> 
> Use architecture-specific logic supporting byte orders instead.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
> ---
>   arch/powerpc/Kconfig | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 9537a61ebae0..6bb2f90e97ea 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -127,6 +127,7 @@ config PPC
>   	select ARCH_DMA_DEFAULT_COHERENT	if !NOT_COHERENT_CACHE
>   	select ARCH_ENABLE_MEMORY_HOTPLUG
>   	select ARCH_ENABLE_MEMORY_HOTREMOVE
> +	select ARCH_HAS_CC_CAN_LINK
>   	select ARCH_HAS_COPY_MC			if PPC64
>   	select ARCH_HAS_CURRENT_STACK_POINTER
>   	select ARCH_HAS_DEBUG_VIRTUAL
> @@ -1342,6 +1343,20 @@ endif
>   config PPC_LIB_RHEAP
>   	bool
>   
> +config ARCH_CC_CAN_LINK
> +	bool
> +	default $(cc_can_link_user,$(m64-flag) -mlittle-endian) if 64BIT && CPU_LITTLE_ENDIAN
> +	default $(cc_can_link_user,$(m64-flag) -mbig-endian) if 64BIT && CPU_BIG_ENDIAN
> +	default $(cc_can_link_user,$(m32-flag) -mlittle-endian) if CPU_LITTLE_ENDIAN
> +	default $(cc_can_link_user,$(m32-flag) -mbig-endian) if CPU_BIG_ENDIAN
> +
> +config ARCH_USERFLAGS
> +	string
> +	default "$(m64-flag) -mlittle-endian" if 64BIT && CPU_LITTLE_ENDIAN
> +	default "$(m64-flag) -mbig-endian" if 64BIT && CPU_BIG_ENDIAN
> +	default "$(m32-flag) -mlittle-endian" if CPU_LITTLE_ENDIAN
> +	default "$(m32-flag) -mbig-endian" if CPU_BIG_ENDIAN
> +
>   source "arch/powerpc/kvm/Kconfig"
>   
>   source "kernel/livepatch/Kconfig"
> 
> ---
> base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> change-id: 20251222-cc-can-link-powerpc-5ddd2469fd5b
> 
> Best regards,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ