]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 20:09:47 +0000 (21:09 +0100)
commit2c58a49f2a07d797ea74b09dcaacb9fe593862aa
tree10aeaac894152a71d51b2d79dff562a7b5476952
parent3409dd1ddb38211e461de1a34951e635fc6bcbfa
netfilter: nf_conncount: move all list iterations under spinlock

commit 2f971a8f425545da52ca0e6bee81f5b1ea0ccc5f upstream.

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: 5c789e131cbb9 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_conncount.c