ipv6: use siphash in rt6_exception_hash()
authorEric Dumazet <edumazet@google.com>
Wed, 25 Aug 2021 23:17:28 +0000 (16:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Sep 2021 08:09:24 +0000 (10:09 +0200)
commitdced8347a727528b388f04820f48166f1e651af6
tree9138785985ed4736fd072efaeef54f703b03d0e3
parentf517335a61ff8037b18ba1b0a002c1f82926a934
ipv6: use siphash in rt6_exception_hash()

[ Upstream commit 4785305c05b25a242e5314cc821f54ade4c18810 ]

A group of security researchers brought to our attention
the weakness of hash function used in rt6_exception_hash()

Lets use siphash instead of Jenkins Hash, to considerably
reduce security risks.

Following patch deals with IPv4.

Fixes: 35732d01fe31 ("ipv6: introduce a hash table to store dst cache")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Keyu Man <kman001@ucr.edu>
Cc: Wei Wang <weiwan@google.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Acked-by: Wei Wang <weiwan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/route.c