Thread (16 messages) 16 messages, 3 authors, 2026-01-02
STALE206d

[PATCH 1/5] ARC: uapi: Stop leaking CONFIG_ARC_HAS_SWAPE reference to userspace

From: Thomas Weißschuh <hidden>
Date: 2025-12-30 07:11:00
Also in: lkml
Subsystem: synopsys arc architecture, the rest · Maintainers: Vineet Gupta, Linus Torvalds

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
exception in headers_install.sh can also be removed.

Signed-off-by: Thomas Weißschuh <redacted>
---
 arch/arc/include/uapi/asm/swab.h | 2 +-
 scripts/headers_install.sh       | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arc/include/uapi/asm/swab.h b/arch/arc/include/uapi/asm/swab.h
index 8d1f1ef44ba7..b2cede1b74b9 100644
--- a/arch/arc/include/uapi/asm/swab.h
+++ b/arch/arc/include/uapi/asm/swab.h
@@ -20,7 +20,7 @@
 #include <linux/types.h>
 
 /* Native single cycle endian swap insn */
-#ifdef CONFIG_ARC_HAS_SWAPE
+#if defined(__KERNEL__) && defined(CONFIG_ARC_HAS_SWAPE)
 
 #define __arch_swab32(x)		\
 ({					\
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 <file-name>:<CONFIG-option> 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
-- 
2.52.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help