[PATCH 2/5] ARM: uapi: Stop leaking CONFIG_CPU_ENDIAN_BE8 reference to userspace

Thomas Weißschuh <[email protected]>
Newsgroups org.infradead.lists.linux-snps-arc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <20251230-headers_install-config-leak-v1-2-efba5c58073d@linutronix.de>
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 same way other kconfig references in this file
are handled. 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 <[email protected]>
---
 arch/arm/include/uapi/asm/ptrace.h | 2 +-
 scripts/headers_install.sh         | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/include/uapi/asm/ptrace.h b/arch/arm/include/uapi/asm/ptrace.h
index 8896c23ccba7..fe656da1701b 100644
--- a/arch/arm/include/uapi/asm/ptrace.h
+++ b/arch/arm/include/uapi/asm/ptrace.h
@@ -105,7 +105,7 @@
 /*
  * Default endianness state
  */
-#ifdef CONFIG_CPU_ENDIAN_BE8
+#if defined(__KERNEL__) && defined(CONFIG_CPU_ENDIAN_BE8)
 #define PSR_ENDSTATE	PSR_E_BIT
 #else
 #define PSR_ENDSTATE	0
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 <file-name>:<CONFIG-option> 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

-- 
2.52.0


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.