From: Vic B <linux@vicb.net>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] security: Restrict unprivileged access to /proc/config.gz
Date: Mon, 9 Nov 2026 23:19:52 +0100 [thread overview]
Message-ID: <avJHCL9Uu1Ud3GCT@vicb.net> (raw)
In-Reply-To: <2026110958-outlying-dreamy-b249@gregkh>
On Mon, Nov 09, 2026 at 03:38:16PM -0500, Greg KH wrote:
> On Sun, Nov 08, 2026 at 03:23:51PM +0100, Vic B wrote:
> > When using CONFIG_IKCONFIG_PROC, the built-in configuration is
> > world-readable through /proc/config.gz, which somewhat weakens existing
> > address hiding defences, as it allows an unprivileged user to simply
> > read built-in config from the running kernel and build their own copy
> > with identical System.map.
> >
> > This patch adds a configuration option to restrict access to
> > /proc/config.gz to superuser only.
> >
> > Signed-off-by: Vic B <linux@vicb.net>
>
> Full name please.
>
> But really, a .config file is not a secret, this isn't needed, sorry.
On all my systems (Debian + mainline kernel) the .config file actually
reveals System.map - all that's needed to get matching (fully identical)
System.map is to grab the config and build mainline kernel sources of
the running version under highly predictable build environment (i.e.,
under same distro, which is also strongly indicated by the fact
that the running kernels are installed as deb packages).
So the goal of hiding .config is to hide System.map, for same resons why
there's kptr_restrict in /proc/sys/kernel.
In particular, the problem I'm trying to avoid is that if an attacker
learns even one runtime address, with matching System.map (or just
.config in my case), they may calculate KASLR offset and derive
addresses of other symbols (more precisely, as I don't use
CONFIG_MODULES, all other symbols).
If access restrictitions on /proc/config.gz aren't needed, the only
solution probably is to disable CONFIG_IKCONFIG_PROC (which
actually is kind of access restriction anyway). May be feasible,
but I'm gonna miss /proc/config.gz...
Vic
> greg k-h
>
prev parent reply other threads:[~2026-11-09 22:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 14:23 Vic B
2026-11-09 20:38 ` Greg KH
2026-11-09 22:19 ` Vic B [this message]
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=avJHCL9Uu1Ud3GCT@vicb.net \
--to=linux@vicb.net \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.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®