Re: [PATCH net-next v2] net: avoid hashing the namespace pointer for device names
From: Eric Dumazet
Date: Wed Nov 18 2026 - 03:36:19 EST
Le mer. 18 nov. 2026 à 07:27, Zhengchuan Liang <zcliangcn@xxxxxxxxx> a écrit :
>
> dev_name_hash() salts device-name hashes with the network namespace
> pointer. An unprivileged user can time SIOCGIFINDEX lookups for chosen
> missing names and identify collisions with a resident name such as "lo".
> Ranking this collision pattern across possible KASLR slides recovers the
> init_net pointer and thus the kernel text base.
>
> Use an unsalted name hash. Each network namespace has a separate hash
> table, so this does not change lookup or namespace-isolation semantics.
>
> Found by AI-assisted code review and reproduced unprivileged on an
> unmodified kernel without fault injection. The reproducer and networking
> selftests pass with this change.
>
> Fixes: 8387ff2577eb ("vfs: make the string hashes salt the hash")
> Cc: stable@xxxxxxxxxxxxxxx
As discussed in v1, local KASLR attacks are not a serious concern,
this is why I asked for net-next.
A "Cc: stable" tag does not belong in a net-next patch.
Maintainers can probably remove it when applying, no need for a V3.
Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>