[NETFILTER]: ip_conntrack: fix invalid conntrack statistics RCU assumption
commitabbaccda4c364815b8b1a82c45a94f60760e13e1
authorPatrick McHardy <kaber@trash.net>
Mon, 12 Feb 2007 19:13:14 +0000 (12 11:13 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Feb 2007 19:13:14 +0000 (12 11:13 -0800)
tree58e28cc25db59456092fc760b7a29e6d223610c5
parent923f4902fefdf4e89b0fb32c4e069d4f57d704f5
[NETFILTER]: ip_conntrack: fix invalid conntrack statistics RCU assumption

CONNTRACK_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 ip_conntrack_lock.

Add CONNTRACK_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>
include/linux/netfilter_ipv4/ip_conntrack.h
net/ipv4/netfilter/ip_conntrack_core.c