[NETFILTER]: nf_conntrack: fix invalid conntrack statistics RCU assumption
NF_CT_STAT_INC assumes rcu_read_lock in nf_hook_slow disables preemption as well, making it legal to use __get_cpu_var without disabling preemption manually. The assumption is not correct anymore with preemptable RCU, additionally we need to protect against softirqs when not holding nf_conntrack_lock. Add NF_CT_STAT_INC_ATOMIC macro, which disables local softirqs, and use where necessary. Signed-off-by:Patrick McHardy <kaber@trash.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/net/netfilter/nf_conntrack.h 6 additions, 0 deletionsinclude/net/netfilter/nf_conntrack.h
- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c 2 additions, 2 deletionsnet/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
- net/netfilter/nf_conntrack_core.c 7 additions, 7 deletionsnet/netfilter/nf_conntrack_core.c
Loading
Please register or sign in to comment