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: <20251230-headers_install-config-leak-v1-3-efba5c58073d@linutronix.de>
Date: Tue, 30 Dec 2025 08:10:58 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Vineet Gupta <vgupta@...nel.org>, Russell King <linux@...linux.org.uk>, 
 Dinh Nguyen <dinguyen@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, 
 Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
 Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org, 
 "H. Peter Anvin" <hpa@...or.com>
Cc: linux-snps-arc@...ts.infradead.org, linux-kernel@...r.kernel.org, 
 linux-arm-kernel@...ts.infradead.org, Arnd Bergmann <arnd@...db.de>, 
 Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 3/5] nios2: uapi: Stop leaking
 CONFIG_NIOS2_CI_SWAB_{NO,SUPPORT} references to userspace

UAPI headers are not supposed to leak references to kconfig symbols.
These won't be set when building userspace. Hide the kconfig reference
behind 'ifdef __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 <thomas.weissschuh@...utronix.de>
---
 arch/nios2/include/uapi/asm/swab.h | 2 ++
 scripts/headers_install.sh         | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/nios2/include/uapi/asm/swab.h b/arch/nios2/include/uapi/asm/swab.h
index 9750547a5f82..bbfa9bd10b2f 100644
--- a/arch/nios2/include/uapi/asm/swab.h
+++ b/arch/nios2/include/uapi/asm/swab.h
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 #include <asm-generic/swab.h>
 
+#ifdef __KERNEL__
 #ifdef CONFIG_NIOS2_CI_SWAB_SUPPORT
 #ifdef __GNUC__
 
@@ -34,5 +35,6 @@ static inline __attribute__((const)) __u32 __arch_swab32(__u32 x)
 
 #endif /* __GNUC__ */
 #endif /* CONFIG_NIOS2_CI_SWAB_SUPPORT */
+#endif /* __KERNEL__ */
 
 #endif /* _ASM_NIOS2_SWAB_H */
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 <file-name>:<CONFIG-option> 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
 "

-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ