summaryrefslogtreecommitdiff
path: root/net/batman-adv/Makefile
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-11-24 23:14:47 (GMT)
committerPablo Neira Ayuso <pablo@netfilter.org>2015-01-06 21:27:45 (GMT)
commit8ca3f5e974f2b4b7f711589f4abff920db36637a (patch)
tree96c599dd113c822d1a666bc2a049c3778acd1aeb /net/batman-adv/Makefile
parent7b5bca4676c7cd78b0f1ef8a132ef3ba9863c9ef (diff)
downloadlinux-8ca3f5e974f2b4b7f711589f4abff920db36637a.tar.xz
netfilter: conntrack: fix race between confirmation and flush
Commit 5195c14c8b27c ("netfilter: conntrack: fix race in __nf_conntrack_confirm against get_next_corpse") aimed to resolve the race condition between the confirmation (packet path) and the flush command (from control plane). However, it introduced a crash when several packets race to add a new conntrack, which seems easier to reproduce when nf_queue is in place. Fix this race, in __nf_conntrack_confirm(), by removing the CT from unconfirmed list before checking the DYING bit. In case race occured, re-add the CT to the dying list This patch also changes the verdict from NF_ACCEPT to NF_DROP when we lose race. Basically, the confirmation happens for the first packet that we see in a flow. If you just invoked conntrack -F once (which should be the common case), then this is likely to be the first packet of the flow (unless you already called flush anytime soon in the past). This should be hard to trigger, but better drop this packet, otherwise we leave things in inconsistent state since the destination will likely reply to this packet, but it will find no conntrack, unless the origin retransmits. The change of the verdict has been discussed in: https://www.marc.info/?l=linux-netdev&m=141588039530056&w=2 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/batman-adv/Makefile')
0 files changed, 0 insertions, 0 deletions