linux/include/net/netns
Eric Dumazet a1c2f32297 netns: provide pure entropy for net_hash_mix()
[ Upstream commit 355b985537 ]

net_hash_mix() currently uses kernel address of a struct net,
and is used in many places that could be used to reveal this
address to a patient attacker, thus defeating KASLR, for
the typical case (initial net namespace, &init_net is
not dynamically allocated)

I believe the original implementation tried to avoid spending
too many cycles in this function, but security comes first.

Also provide entropy regardless of CONFIG_NET_NS.

Fixes: 0b4419162a ("netns: introduce the net_hash_mix "salt" for hashes")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Amit Klein <aksecurity@gmail.com>
Reported-by: Benny Pinkas <benny@pinkas.net>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-17 08:38:40 +02:00
..
can.h
conntrack.h
core.h
dccp.h
generic.h
hash.h netns: provide pure entropy for net_hash_mix() 2019-04-17 08:38:40 +02:00
ieee802154_6lowpan.h
ipv4.h net: ipv4: Control SKB reprioritization after forwarding 2018-08-01 09:52:30 -07:00
ipv6.h ipv6: Add icmp_echo_ignore_all support for ICMPv6 2018-08-13 08:42:25 -07:00
mib.h
mpls.h
netfilter.h
nftables.h netfilter: nf_tables: use dedicated mutex to guard transactions 2018-07-18 11:26:48 +02:00
packet.h
sctp.h
unix.h
x_tables.h
xfrm.h