From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: nf_tables: call skb_valid_dst() before skb_dst()
Date: Wed, 29 Jul 2026 11:45:01 +0200 [thread overview]
Message-ID: <amnLnSkq53NgaFs_@chamomile> (raw)
In-Reply-To: <5ee31f48-b783-4e2a-8c35-933ef7fd9a66@suse.de>
Hi Fernando,
On Wed, Jul 29, 2026 at 11:33:24AM +0200, Fernando Fernandez Mancera wrote:
> On 7/28/26 10:40 AM, Pablo Neira Ayuso wrote:
> > When fetching the dst_entry from the skb, check if it valid, ie. this is
> > not a template dst.
> >
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
>
> Hi Pablo,
>
> I used a coccinelle script to see if this pattern is present in other
> places. So far in Netfilter I have found this in
> net/ipv6/netfilter/nf_reject_ipv6.c:nf_send_reset6()
>
> if (!skb_dst(oldskb)) {
> nf_ip6_route(net, &dst, flowi6_to_flowi(&fl6), false);
> if (!dst)
> return;
> skb_dst_set(oldskb, dst);
> }
>
> If I am not wrong the same problem happens here too.
Good point.
It was intentional, I thought this is never called from netdev
ingress/egress.
I can expand the commit message to explicitly mention that the
intention is to check for valid dst in the netdev/ingress,egrees paths
where the template dst can be seen.
But, after second glance, this can be indeed called from
NF_INET_INGRESS.
So this chunk is really needed, I will post v2, thanks!
prev parent reply other threads:[~2026-07-29 9:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 8:40 [PATCH nf-next] netfilter: nf_tables: call skb_valid_dst() before skb_dst() Pablo Neira Ayuso
2026-07-29 9:33 ` Fernando Fernandez Mancera
2026-07-29 9:45 ` Pablo Neira Ayuso [this message]
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=amnLnSkq53NgaFs_@chamomile \
--to=pablo@netfilter.org \
--cc=fmancera@suse.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 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.