From: Zhengchuan Liang <zcliangcn@gmail.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhengchuan Liang <zcliangcn@gmail.com>
Subject: [PATCH net 0/1] net: netdev name hash leaks kernel text base
Date: Thu, 1 Oct 2026 23:52:45 -0700 [thread overview]
Message-ID: <cover.1790917676.git.zcliangcn@gmail.com> (raw)
Hi,
An unprivileged user can recover the kernel text base and defeat KASLR by
timing SIOCGIFINDEX lookups for attacker-chosen nonexistent interface
names. These lookups reach dev_get_by_name_rcu() and fail with ENODEV
without requiring capabilities or changes to network devices.
dev_name_hash() passes the struct net pointer to full_name_hash() as its
salt. A missing name that hashes to the same bucket as a resident name,
such as "lo", requires an extra chain traversal and takes measurably
longer to look up. For a known kernel image, the collision pattern across
possible KASLR slides identifies the runtime address of init_net and thus
the kernel text base.
I reproduced the issue as an unprivileged user on x86-64 and arm64.
A tested reproducer is available privately to maintainers on request.
Zhengchuan Liang (1):
net: use random salt for netdev name hash to prevent text base leak
net/core/dev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--
2.25.1
next reply other threads:[~2026-10-02 6:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 6:52 Zhengchuan Liang [this message]
2026-10-02 6:52 ` [PATCH net 1/1] net: use random salt for netdev name hash to prevent text base leak Zhengchuan Liang
2026-10-02 8:20 ` Eric Dumazet
2026-10-02 15:51 ` Linus Torvalds
2026-10-02 6:59 ` [PATCH net 0/1] net: netdev name hash leaks kernel text base netdev-bot+sinfo
2026-10-02 7:35 ` Zhengchuan Liang
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=cover.1790917676.git.zcliangcn@gmail.com \
--to=zcliangcn@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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®