]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: use jhash as hashfn for rhashtable
authorDaniel Borkmann <dborkman@redhat.com>
Wed, 10 Dec 2014 15:33:10 +0000 (16:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Dec 2014 20:17:45 +0000 (15:17 -0500)
commit119d6160c910e9af22d2511a6cd3915266573829
treeb70a8c285a3d413e90f4329db76b1cc777d1de03
parent9f00559d13d6d8fed7a3af7e854a9cf908aa25c1
netlink: use jhash as hashfn for rhashtable

For netlink, we shouldn't be using arch_fast_hash() as a hashing
discipline, but rather jhash() instead.

Since netlink sockets can be opened by any user, a local attacker
would be able to easily create collisions with the DPDK-derived
arch_fast_hash(), which trades off performance for security by
using crc32 CPU instructions on x86_64.

While it might have a legimite use case in other places, it should
be avoided in netlink context, though. As rhashtable's API is very
flexible, we could later on still decide on other hashing disciplines,
if legitimate.

Reference: http://thread.gmane.org/gmane.linux.kernel/1844123
Fixes: 474f8106cf69 ("netlink: Convert netlink_lookup() to use RCU protected hash table")
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c