From: Florian Westphal <fw@strlen.de>
To: Fang Xieyan <fangxy@xiaopeng.com>
Cc: pablo@netfilter.org, phil@nwl.cc, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Weibin Liu <liuwb@xiaopeng.com>
Subject: Re: [PATCH] netfilter: xt_policy: add NULL check for skb_dst() in output policy match
Date: Mon, 26 Oct 2026 14:14:00 +0100 [thread overview]
Message-ID: <at9SGAuHjV3OjFKZ@strlen.de> (raw)
In-Reply-To: <20261026125313.14810-1-fangxy@xiaopeng.com>
Fang Xieyan <fangxy@xiaopeng.com> wrote:
> match_policy_out() accesses dst->xfrm without checking whether
> skb_dst() returned NULL. If no dst entry is attached to the skb,
> this dereference is invalid.
If there is no dst we'd have crashed already:
return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT,
net, sk, skb, NULL, skb_dst_dev(skb),
dst_output);
likewise, okter in ip stack:
if (lwtunnel_xmit_redirect(dst->lwtstate)) {
there are several other places that don't do NULL checks here.
So either all of those need them or none at all.
next prev parent reply other threads:[~2026-10-26 13:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 12:53 Fang Xieyan
2026-10-26 13:14 ` Florian Westphal [this message]
2026-10-26 15:34 ` Fang Xieyan
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=at9SGAuHjV3OjFKZ@strlen.de \
--to=fw@strlen.de \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fangxy@xiaopeng.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuwb@xiaopeng.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
/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
all inboxes | Powered by JetHome®