]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_conncount: move all list iterations under spinlock
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 28 Dec 2018 00:24:47 +0000 (01:24 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 29 Dec 2018 01:45:21 +0000 (02:45 +0100)
commit8b2953a64bdd64839106bfc84639c914f33ef5a5
tree0b62fd460a49546309f6684ef2a6d09547b50862
parent6c373146c9041e4132607af32f3d00534533ee37
netfilter: nf_conncount: move all list iterations under spinlock

Two CPUs may race to remove a connection from the list, the existing
conn->dead will result in a use-after-free. Use the per-list spinlock to
protect list iterations.

As all accesses to the list now happen while holding the per-list lock,
we no longer need to delay free operations with rcu.

Joint work with Florian.

Fixes: 638ffa8ee8a04 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search")
Reviewed-by: Shawn Bohrer <sbohrer@cloudflare.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conncount.c