]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:20 +0000 (09:23 +0200)
commita6b618a5afbe38f75de5d26e28a9f8e1ae22c366
tree7e94787c1f2e9c5d8f768dce21d1f4b870a69222
parent6b65bc247536c64d4380fffc6a61e9dafc6f0c1d
netfilter: conntrack: re-fetch conntrack after insertion

BugLink: https://bugs.launchpad.net/bugs/1981862
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/net/netfilter/nf_conntrack_core.h