]> git.baikalelectronics.ru Git - kernel.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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 13 Aug 2019 16:03:11 +0000 (18:03 +0200)
commitf83d89b7fcc39ff29169fd87886129ca808607c2
tree1186dee56773e7bdd5de75aeb7d42718091d91cb
parentaf46bd490751402b6427c8b5141cb756c0b82bee
netfilter: conntrack: Use consistent ct id hash calculation

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: 69206e48b751fd4 ("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>
net/netfilter/nf_conntrack_core.c