]> www.infradead.org Git - users/dwmw2/linux.git/commit
netfilter: conntrack: re-fetch conntrack after insertion
authorFlorian Westphal <fw@strlen.de>
Thu, 19 May 2022 22:02:04 +0000 (00:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 06:48:54 +0000 (08:48 +0200)
commit04e4a11dc723c52db7a36dc58f0d69ce6426f8f0
tree57dd3c5c758db5b93eda19e7569d5535195d2a6a
parent86c0154f4c3a56c5db8b9dd09e3ce885382c2c19
netfilter: conntrack: re-fetch conntrack after insertion

commit 56b14ecec97f39118bf85c9ac2438c5a949509ed upstream.

In case the conntrack is clashing, insertion can free skb->_nfct and
set skb->_nfct to the already-confirmed entry.

This wasn't found before because the conntrack entry and the extension
space used to free'd after an rcu grace period, plus the race needs
events enabled to trigger.

Reported-by: <syzbot+793a590957d9c1b96620@syzkaller.appspotmail.com>
Fixes: 71d8c47fc653 ("netfilter: conntrack: introduce clash resolution on insertion race")
Fixes: 2ad9d7747c10 ("netfilter: conntrack: free extension area immediately")
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>
include/net/netfilter/nf_conntrack_core.h