All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC nf 0/2] netfilter: add restrictions/validations for packet rewrites
@ 2026-05-27 12:11 Florian Westphal
  2026-05-27 12:11 ` [RFC nf 1/2] netfilter: nfnetlink_queue: restrict writes to network header Florian Westphal
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Florian Westphal @ 2026-05-27 12:11 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

This is a followup to the recent patch that disabled packet manipulation
via nfqueue or nft_payload in user namespaces.

This adds additional *restrictions*.
For nfqueue, do minimal header checks in case userspace provides payload
replacement data.

For nft_payload, restrict the offset/length combinations.

Several of these checks could be done at rule insertion time (i.e.
control plane).
Risk is that this may cause ruleset load failures for existing rulesets.
With this change such writes are silently skipped and packet passes
unchanged.

Restriction is added for link and network bases only.

Open questions:
- target tree: nf or nf-next?
- should there be an immediate followup ('patch 3') that reverts
  the userns restrictions again?
- should nft_payload reject those requests it can validate there from
  the control plane?

I would propose to target nf-next for now and leave the userns
restrictions in place to see what relevant use-cases exist.

Florian Westphal (2):
  netfilter: nfnetlink_queue: restrict writes to network header
  netfilter: nftables: restrict linklayer and network header writes

 net/netfilter/nfnetlink_queue.c | 103 +++++++++++++++++++-
 net/netfilter/nft_payload.c     | 166 ++++++++++++++++++++++++++++++++
 2 files changed, 268 insertions(+), 1 deletion(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-06-04  6:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 12:11 [RFC nf 0/2] netfilter: add restrictions/validations for packet rewrites Florian Westphal
2026-05-27 12:11 ` [RFC nf 1/2] netfilter: nfnetlink_queue: restrict writes to network header Florian Westphal
2026-05-27 12:11 ` [RFC nf 2/2] netfilter: nftables: restrict linklayer and network header writes Florian Westphal
2026-06-03 22:33 ` [RFC nf 0/2] netfilter: add restrictions/validations for packet rewrites Pablo Neira Ayuso
2026-06-03 22:42   ` Pablo Neira Ayuso
2026-06-03 23:11     ` Florian Westphal
2026-06-04  6:17       ` Pablo Neira Ayuso

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.