]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 23 May 2018 07:17:24 +0000 (09:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 23 May 2018 07:26:08 +0000 (09:26 +0200)
commit675a4a352e5481ff2f3f27ac16d20f2a7704c26c
tree8b985310c86b4aa4ac837e4c66b3941371989429
parent912ce233baa29ef10ad23754c27294f3497e4548
netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks

In nfqueue, two consecutive skbuffs may race to create the conntrack
entry. Hence, the one that loses the race gets dropped due to clash in
the insertion into the hashes from the nf_conntrack_confirm() path.

This patch adds a new nf_conntrack_update() function which searches for
possible clashes and resolve them. NAT mangling for the packet losing
race is corrected by using the conntrack information that won race.

In order to avoid direct module dependencies with conntrack and NAT, the
nf_ct_hook and nf_nat_hook structures are used for this purpose.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter.h
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_nat_core.c
net/netfilter/nfnetlink_queue.c