netfilter: conntrack: make conntrack userspace helpers work again
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 24 May 2020 17:52:10 +0000 (19:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 25 May 2020 18:39:14 +0000 (20:39 +0200)
commitee04805ff54a63ffd90bc6749ebfe73473734ddb
treece5e9cae290304c6c3c0773966b5814349cb9756
parent4c559f15efcc43b996f4da528cd7f9483aaca36d
netfilter: conntrack: make conntrack userspace helpers work again

Florian Westphal says:

"Problem is that after the helper hook was merged back into the confirm
one, the queueing itself occurs from the confirm hook, i.e. we queue
from the last netfilter callback in the hook-list.

Therefore, on return, the packet bypasses the confirm action and the
connection is never committed to the main conntrack table.

To fix this there are several ways:
1. revert the 'Fixes' commit and have a extra helper hook again.
   Works, but has the drawback of adding another indirect call for
   everyone.

2. Special case this: split the hooks only when userspace helper
   gets added, so queueing occurs at a lower priority again,
   and normal enqueue reinject would eventually call the last hook.

3. Extend the existing nf_queue ct update hook to allow a forced
   confirmation (plus run the seqadj code).

This goes for 3)."

Fixes: 827318feb69cb ("netfilter: conntrack: remove helper hook again")
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_core.c