Files
twx-linux/include/net
Eric Dumazet 6996763856 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-17 08:36:46 +02:00
..
2018-09-29 03:07:30 -07:00
2019-03-23 13:19:44 +01:00
2019-02-23 09:05:59 +01:00
2018-10-18 09:13:21 +02:00
2016-09-23 08:38:50 -04:00
2017-06-07 12:07:46 +02:00
2019-03-13 14:04:53 -07:00
2016-10-14 10:59:15 -04:00
2018-10-18 09:13:24 +02:00
2016-10-03 02:00:22 -04:00
2016-10-04 02:11:51 -04:00
2018-05-16 10:08:41 +02:00
2018-02-25 11:05:48 +01:00
2017-07-21 07:42:18 +02:00