mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Vineet Gupta" <vgupta@kernel.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"Dinh Nguyen" <dinguyen@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/5] nios2: uapi: Stop leaking CONFIG_NIOS2_CI_SWAB_{NO,SUPPORT} references to userspace
Date: Tue, 30 Dec 2025 22:19:22 +0100	[thread overview]
Message-ID: <93c55086-931a-4282-a94c-de4954047fa9@app.fastmail.com> (raw)
In-Reply-To: <20251230-headers_install-config-leak-v1-3-efba5c58073d@linutronix.de>

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 '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@linutronix.de>

Acked-by: Arnd Bergmann <arnd@arndb.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__
> 

I'm fairly sure this approach is correct, but I noticed
that this makes arch/nios2/include/uapi/asm/swab.h empty
in userspace, so you could just move the current file
to arch/nios2/include/asm/swab.h instead and fall back to
the asm-generic header for uapi.

     Arnd

  reply	other threads:[~2025-12-30 21:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30  7:10 [PATCH 0/5] uapi: fix remaining kconfig leaks in UAPI headers Thomas Weißschuh
2025-12-30  7:10 ` [PATCH 1/5] ARC: uapi: Stop leaking CONFIG_ARC_HAS_SWAPE reference to userspace Thomas Weißschuh
2025-12-30 21:23   ` Arnd Bergmann
2026-01-02  7:55     ` Thomas Weißschuh
2026-01-02  9:40       ` Thomas Weißschuh
2026-01-02 10:31         ` Arnd Bergmann
2026-01-02 21:53     ` Vineet Gupta
2025-12-30  7:10 ` [PATCH 2/5] ARM: uapi: Stop leaking CONFIG_CPU_ENDIAN_BE8 " Thomas Weißschuh
2025-12-30 14:20   ` Arnd Bergmann
2025-12-30 14:33     ` Thomas Weißschuh
2025-12-30  7:10 ` [PATCH 3/5] nios2: uapi: Stop leaking CONFIG_NIOS2_CI_SWAB_{NO,SUPPORT} references " Thomas Weißschuh
2025-12-30 21:19   ` Arnd Bergmann [this message]
2025-12-30  7:10 ` [PATCH 4/5] x86/uapi: Stop leaking kconfig " Thomas Weißschuh
2025-12-30 21:08   ` Arnd Bergmann
2026-01-02  9:30     ` Thomas Weißschuh
2025-12-30  7:11 ` [PATCH 5/5] scripts: headers_install.sh: Remove config leak ignore machinery Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93c55086-931a-4282-a94c-de4954047fa9@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dinguyen@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vgupta@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®