mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-02 00:40:59 -05:00
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: <[email protected]>
Fixes: 71d8c47fc6 ("netfilter: conntrack: introduce clash resolution on insertion race")
Fixes: 2ad9d7747c10 ("netfilter: conntrack: free extension area immediately")
Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
1fe82bfd9e
commit
b16bb37398
1 changed files with 6 additions and 1 deletions
|
|
@ -59,8 +59,13 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
|
|||
int ret = NF_ACCEPT;
|
||||
|
||||
if (ct) {
|
||||
if (!nf_ct_is_confirmed(ct))
|
||||
if (!nf_ct_is_confirmed(ct)) {
|
||||
ret = __nf_conntrack_confirm(skb);
|
||||
|
||||
if (ret == NF_ACCEPT)
|
||||
ct = (struct nf_conn *)skb_nfct(skb);
|
||||
}
|
||||
|
||||
if (likely(ret == NF_ACCEPT))
|
||||
nf_ct_deliver_cached_events(ct);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue