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: <20250903223131.GA2264021@ax162>
Date: Wed, 3 Sep 2025 15:31:31 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: Nicolas Schier <nicolas.schier@...ux.dev>, linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Masahiro Yamada <masahiroy@...nel.org>
Subject: Re: [PATCH 2/2] kbuild: userprogs: also inherit byte order and ABI
 from kernel

On Mon, Sep 01, 2025 at 11:51:03AM +0200, Thomas Weißschuh wrote:
> Exactly. The normal cases can be handled generically. For example the kconfig
> below works for architectures which only differ in byte order and 32bit/64bit,
> which are most of them. MIPS should require more logic.
> Also I'm ignoring x32, as it is never the kernel's native ABI.
> 
>  config 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,$(m64-flag)) if 64BIT
> +       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
>         default $(cc_can_link_user,$(m32-flag))
> 
> 
> > Feels like that could get complicated quickly but this would probably be
> > the objectively most robust and "hands off" option.
> 
> Agreed.

Nicolas might feel differently but this does not seem terrible to me,
especially with a macro to wrap the common logic, which is where I felt
like things could get unwieldy. Feel free to send an RFC if it is not
too much work.

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ