From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nf-next 0/2] netfilter: do not assume skb->sk is inet sk
Date: Thu, 1 Oct 2026 14:06:19 +0200 [thread overview]
Message-ID: <20261001120625.29659-1-fw@strlen.de> (raw)
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
next reply other threads:[~2026-10-01 12:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 12:06 Florian Westphal [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261001120625.29659-1-fw@strlen.de \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox