Re: [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 <20251230152519-1f7ea27a-10de-4d0c-9dd0-04eb0588d733@linutronix.de>
On Tue, Dec 30, 2025 at 03:20:10PM +0100, Arnd Bergmann wrote:
> On Tue, Dec 30, 2025, at 08:10, Thomas Weißschuh wrote:
> > 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]>
> 
> According to codesearch.debian.net, there are no actual users of
> this definition outside of the kernel, and there really shouldn't
> be either.
> 
> It should be both safe and correct to open-code PSR_ENDSTATE
> in the two file where it is used as
> 
>  if (IS_ENABLED(CONFIG_CPU_ENDIAN_BE8))
>         regs->ARM_cpsr |= PSR_E_BIT
> 
> and then remove the definition from the header. Alternatively
> it could be moved into the non-uapi header, or you can have
> an #ifdef around both of them.

These alternatives work for me, too. I went with the current aproach as
it matches what the rest of the file is doing and it won't break users.

I'll do the open-coding as proposed above.


Thomas

_______________________________________________
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.