Commit d110bbcc authored by Pablo Neira's avatar Pablo Neira Committed by Patrick McHardy

[NETFILTER]: fix stats in __ip_conntrack_confirm

net_rx_softirq can preempt the calling process while incrementing the stats.
I think that we can fix this moving both CONNTRACK_STAT_INC to the locked
section. 
Signed-off-by: default avatarPablo Neira Ayuso <pablo@eurodev.net>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 2b0b0cc2
...@@ -434,13 +434,14 @@ __ip_conntrack_confirm(struct sk_buff *skb) ...@@ -434,13 +434,14 @@ __ip_conntrack_confirm(struct sk_buff *skb)
add_timer(&ct->timeout); add_timer(&ct->timeout);
atomic_inc(&ct->ct_general.use); atomic_inc(&ct->ct_general.use);
set_bit(IPS_CONFIRMED_BIT, &ct->status); set_bit(IPS_CONFIRMED_BIT, &ct->status);
WRITE_UNLOCK(&ip_conntrack_lock);
CONNTRACK_STAT_INC(insert); CONNTRACK_STAT_INC(insert);
WRITE_UNLOCK(&ip_conntrack_lock);
return NF_ACCEPT; return NF_ACCEPT;
} }
WRITE_UNLOCK(&ip_conntrack_lock);
CONNTRACK_STAT_INC(insert_failed); CONNTRACK_STAT_INC(insert_failed);
WRITE_UNLOCK(&ip_conntrack_lock);
return NF_DROP; return NF_DROP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment