From b4171fd0b091072f403b66bf05d01051d4bd94d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 14 Jan 2026 08:28:13 +0100 Subject: ARC: Always use SWAPE instructions for __arch_swab32() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit 67a697e7576 ("ARC: retire ARC750 support") all supported CPUs have the 'swape' instruction. Always use the implementation of __arch_swabe() which uses 'swape'. ARCH_USE_BUILTIN_BSWAP can not be used as that results on libcalls on -mcpu=arc700. As as side-effect, remove a leak of an internal kconfig symbol through the UAPI headers. Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/0ae2688a-5a22-405b-adaf-9b5ad712b245@app.fastmail.com/ Suggested-by: Vineet Gupta Link: https://lore.kernel.org/lkml/a033a402-e3c5-4982-9fff-b6a4c55817ae@kernel.org/ Signed-off-by: Thomas Weißschuh Signed-off-by: Arnd Bergmann --- scripts/headers_install.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 0e4e939efc94..727f7f82c2c7 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -70,7 +70,6 @@ configs=$(sed -e ' # # The format is : in each line. config_leak_ignores=" -arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8 arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT -- cgit v1.2.3 From 49d7819aa9b0b494d140ae28789b1190acdb9032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 14 Jan 2026 08:28:14 +0100 Subject: ARM: uapi: Drop PSR_ENDSTATE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The symbol PSR_ENDSTATE is pointless for userspace. Drop it from the UAPI headers and instead inline it into the only two callers. As as side-effect, remove a leak of an internal kconfig symbol through the UAPI headers. Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/d2ad12f2-3d65-4bef-890c-65d78a33d790@app.fastmail.com/ Signed-off-by: Thomas Weißschuh Signed-off-by: Arnd Bergmann --- scripts/headers_install.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 727f7f82c2c7..4f03521f4026 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -70,7 +70,6 @@ configs=$(sed -e ' # # The format is : in each line. config_leak_ignores=" -arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8 arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION -- cgit v1.2.3 From 9b21aa9f038184aa49f894e663957933507718d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 14 Jan 2026 08:28:15 +0100 Subject: nios2: uapi: Remove custom asm/swab.h from UAPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UAPI headers are not supposed to leak references to kconfig symbols. They are undefined there in any case. As all actual definitions of this header are guarded behind a kconfig symbol, for userspace the header is always identical to its asm-generic variant. Make the custom UAPI header a kernel-internal one, so the leaks of kconfig symbols are fixed and userspace will instead use asm-generic/swab.h directly. Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/93c55086-931a-4282-a94c-de4954047fa9@app.fastmail.com/ Signed-off-by: Thomas Weißschuh Signed-off-by: Arnd Bergmann --- scripts/headers_install.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 4f03521f4026..613f400a67d1 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -70,8 +70,6 @@ configs=$(sed -e ' # # The format is : in each line. config_leak_ignores=" -arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO -arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64 " -- cgit v1.2.3 From e356da60144bcd06bf2880999f67a6415a7499d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 14 Jan 2026 08:28:16 +0100 Subject: x86/uapi: Stop leaking kconfig references to userspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UAPI headers are not supposed to leak references to kconfig symbols. These won't be set when building userspace. Hide the kconfig reference behind 'if defined(__KERNEL__)', so it will be stripped by headers_install.sh. The result for userspace will be the same, but the exceptions in headers_install.sh can also be removed. Signed-off-by: Thomas Weißschuh Signed-off-by: Arnd Bergmann --- scripts/headers_install.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 613f400a67d1..1301ba68d772 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -70,8 +70,6 @@ configs=$(sed -e ' # # The format is : in each line. config_leak_ignores=" -arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION -arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64 " for c in $configs -- cgit v1.2.3 From adbbd9714f8058730f93c8df5c5bf1679456424b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 14 Jan 2026 08:28:17 +0100 Subject: scripts: headers_install.sh: Remove config leak ignore machinery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are no entries left to ignore and none should be added again. Remove the now unused logic. Signed-off-by: Thomas Weißschuh Signed-off-by: Arnd Bergmann --- scripts/headers_install.sh | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'scripts') diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 1301ba68d772..9c15e748761c 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -64,30 +64,10 @@ configs=$(sed -e ' d ' $OUTFILE) -# The entries in the following list do not result in an error. -# Please do not add a new entry. This list is only for existing ones. -# The list will be reduced gradually, and deleted eventually. (hopefully) -# -# The format is : in each line. -config_leak_ignores=" -" - for c in $configs do - leak_error=1 - - for ignore in $config_leak_ignores - do - if echo "$INFILE:$c" | grep -q "$ignore$"; then - leak_error= - break - fi - done - - if [ "$leak_error" = 1 ]; then - echo "error: $INFILE: leak $c to user-space" >&2 - exit 1 - fi + echo "error: $INFILE: leak $c to user-space" >&2 + exit 1 done rm -f $TMPFILE -- cgit v1.2.3