]> git.baikalelectronics.ru Git - 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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 27 May 2022 09:16:34 +0000 (11:16 +0200)
commit1ff72fc943415569e58eddd4de7c6b0dbd8000ee
treecfa91a2233c73d36e5bbf8cff1e7e07bff92ebf1
parent3345c4ae77f87d7bc9351af98c9a2a25cc48e529
netfilter: conntrack: re-fetch conntrack after insertion

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: 82ae35d224ae ("netfilter: conntrack: introduce clash resolution on insertion race")
Fixes: 0b331c716b85 ("netfilter: conntrack: free extension area immediately")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_conntrack_core.h