All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf 0/2] netfilter: disable support for queueing cloned conntrack entries
@ 2024-08-07 19:28 Florian Westphal
  2024-08-07 19:28 ` [PATCH nf 1/2] netfilter: nf_queue: drop packets with cloned unconfirmed conntracks Florian Westphal
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Florian Westphal @ 2024-08-07 19:28 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

Conntrack assumes an unconfirmed entry (not yet committed to global hash
table) has a refcount of 1 and is not visible to other cores.

With multicast forwarding this assumption breaks down because such
skbs get cloned after being picked up, i.e.  ct->use refcount is > 1.

Likewise, bridge netfilter will clone broad/mutlicast frames and
all frames in case they need to be flood-forwarded during learning
phase.

For ip multicast forwarding or plain bridge flood-forward this will
"work" because packets don't leave softirq and are implicitly
serialized.

With nfqueue this no longer holds true, the packets get queued
and can be reinjected in arbitrary ways.

Disable this feature.

After this patch, nfqueue cannot queue packets except the last
multicast/broadcast packet.

Alternatives:
- queue, but zap skb->nf_conn .  Problem:
  On reinject, packet would match INVALID state.
- same, but make them untracked. Slightly better, but not
  by much.
- check if NAT was applied or not.
  If not, we could theoretically queue and then
  relookup the conntrack on reinject.

This would create a new entry in established, new or invalid
state (userspace can munge the packet).

ATM I would prefer to go with the minimal solution which is
to disable this feature.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-08 21:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 19:28 [PATCH nf 0/2] netfilter: disable support for queueing cloned conntrack entries Florian Westphal
2024-08-07 19:28 ` [PATCH nf 1/2] netfilter: nf_queue: drop packets with cloned unconfirmed conntracks Florian Westphal
2024-08-07 19:28 ` [PATCH nf 2/2] selftests: netfilter: add test for br_netfilter+conntrack+queue combination Florian Westphal
2024-08-07 19:51   ` Florian Westphal
2024-08-08 21:14 ` [PATCH nf v2 " Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.