Files
linux/net
Vasily Khoruzhick 5a1eeb5383 netfilter: conntrack: fix calculation of next bucket number in early_drop
commit f393808dc6 upstream.

If there's no entry to drop in bucket that corresponds to the hash,
early_drop() should look for it in other buckets. But since it increments
hash instead of bucket number, it actually looks in the same bucket 8
times: hsize is 16k by default (14 bits) and hash is 32-bit value, so
reciprocal_scale(hash, hsize) returns the same value for hash..hash+7 in
most cases.

Fix it by increasing bucket number instead of hash and rename _hash
to bucket to avoid future confusion.

Fixes: 3e86638e9a ("netfilter: conntrack: consider ct netns in early_drop logic")
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Vasily Khoruzhick <vasilykh@arista.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-15 09:27:08 +09:00
..
2018-05-16 10:08:44 +02:00
2018-04-13 19:48:29 +02:00
2023-05-15 09:15:10 +09:00
2016-10-20 11:23:08 -04:00
2018-05-16 11:39:34 +02:00
2023-05-15 09:15:02 +09:00
2016-08-17 19:36:23 -04:00
2023-05-15 09:14:58 +09:00