]> www.infradead.org Git - users/dwmw2/linux.git/commit
netfilter: conntrack: Use consistent ct id hash calculation
authorDirk Morris <dmorris@metaloft.com>
Thu, 8 Aug 2019 20:57:51 +0000 (13:57 -0700)
committerSasha Levin <sashal@kernel.org>
Sun, 25 Aug 2019 14:10:35 +0000 (10:10 -0400)
commit9aaf224300b005ed87fae5550ed76a307e49579c
tree2b3d79e308adfa94b6abeec67c12eb23e0c537fe
parent178398e1d821ba2cbeb0ffa636ceeb68c88d4f28
netfilter: conntrack: Use consistent ct id hash calculation

commit 656c8e9cc1badbc18eefe6ba01d33ebbcae61b9a upstream.

Change ct id hash calculation to only use invariants.

Currently the ct id hash calculation is based on some fields that can
change in the lifetime on a conntrack entry in some corner cases. The
current hash uses the whole tuple which contains an hlist pointer which
will change when the conntrack is placed on the dying list resulting in
a ct id change.

This patch also removes the reply-side tuple and extension pointer from
the hash calculation so that the ct id will will not change from
initialization until confirmation.

Fixes: 3c79107631db1f7 ("netfilter: ctnetlink: don't use conntrack/expect object addresses as id")
Signed-off-by: Dirk Morris <dmorris@metaloft.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_conntrack_core.c