mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net 0/1] net: netdev name hash leaks kernel text base
@ 2026-10-02  6:52 Zhengchuan Liang
  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  6:59 ` [PATCH net 0/1] net: netdev name hash leaks kernel text base netdev-bot+sinfo
  0 siblings, 2 replies; 6+ messages in thread
From: Zhengchuan Liang @ 2026-10-02  6:52 UTC (permalink / raw)
  To: David S . Miller
  Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman, netdev,
	linux-kernel, Zhengchuan Liang

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-02 15:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02  6:52 [PATCH net 0/1] net: netdev name hash leaks kernel text base Zhengchuan Liang
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

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®