Linux Netfilter development
 help / color / mirror / Atom feed
* [PATCH nf-next 0/2] netfilter: do not assume skb->sk is inet sk
@ 2026-10-01 12:06 Florian Westphal
  2026-10-01 12:06 ` [PATCH nf-next 1/2] netfilter: add nf_skb_sk helper and use it Florian Westphal
  2026-10-01 12:06 ` [PATCH nf-next 2/2] netfilter: add nf_sk_to_full_sk " Florian Westphal
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Westphal @ 2026-10-01 12:06 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

LLM reported that packet socket could be handed off to an ip tunnel,
where the now tunneled skb retains skb->sk as packet socket.

There are spots where we assume skb->sk is inet socket.  Add helpers
for this and use them where needed.  Not reproducible (no crash / out
of bound access, nft_socket just provides a 'random' result instead of
'no match').

There are more skb->sk users but I could not find bad-access scenarios
for those, they fetch valid sk fields or are restricted to input hooks.

Florian Westphal (2):
  netfilter: add nf_skb_sk helper and use it
  netfilter: add nf_sk_to_full_sk helper and use it

 include/net/netfilter/nf_socket.h | 35 +++++++++++++++++++++++++++++++
 net/ipv4/netfilter.c              |  3 ++-
 net/ipv6/netfilter.c              |  3 ++-
 net/netfilter/nft_socket.c        | 16 +++++++-------
 net/netfilter/xt_socket.c         | 26 ++++++++++++-----------
 5 files changed, 62 insertions(+), 21 deletions(-)

-- 
2.55.0


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

end of thread, other threads:[~2026-10-01 12:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 12:06 [PATCH nf-next 0/2] netfilter: do not assume skb->sk is inet sk Florian Westphal
2026-10-01 12:06 ` [PATCH nf-next 1/2] netfilter: add nf_skb_sk helper and use it Florian Westphal
2026-10-01 12:06 ` [PATCH nf-next 2/2] netfilter: add nf_sk_to_full_sk " Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox