From: Zhou Qiuyue <n0ps1edzz@gmail.com>
To: David Laight <david.laight.linux@gmail.com>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>,
David S. Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Hangbin Liu <hangbin.liu@linux.dev>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net v2] ipv6: raw: fix use-after-free in rawv6_send_hdrinc()
Date: Sat, 31 Oct 2026 01:38:22 +0800 [thread overview]
Message-ID: <179338190237.9376.13820542101227461550@gmail.com> (raw)
In-Reply-To: <20261030160532.4832d994@pumpkin>
Thanks, David.
Yes, in the redirect case it passes the old rt->dst.dev, while skb->dst
has already been replaced. That changes the NF_HOOK outdev, so it
probably belongs in a separate fix.
A bare rt6i_idev or dst.dev pointer looks unsafe, since dropping the old
route drops the refs they rely on. An explicit hold/put could replace the
RCU lock, but adds per-packet refs, and doesn't avoid the deferred route
free. As far as I can tell, that uses the embedded dst rcu_head; the
temporary rt6 in this path comes from the existing HDRINCL lookup, and v2
doesn't add a new alloc/free there.
I'll test moving the RCU read lock before l3mdev_ip6_out().
next prev parent reply other threads:[~2026-10-30 17:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 4:48 Zhou Qiuyue
2026-10-26 6:09 ` Hangbin Liu
2026-10-26 15:07 ` Antoine Tenart
2026-10-27 1:38 ` Hangbin Liu
2026-10-27 9:43 ` Antoine Tenart
2026-10-28 1:27 ` Hangbin Liu
2026-10-28 14:37 ` David Ahern
2026-10-28 7:50 ` netdev-bot+sashiko
2026-10-30 9:40 ` patchwork-bot+netdevbpf
2026-10-30 16:05 ` David Laight
2026-10-30 17:38 ` Zhou Qiuyue [this message]
2026-10-30 19:52 ` David Laight
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=179338190237.9376.13820542101227461550@gmail.com \
--to=n0ps1edzz@gmail.com \
--cc=davem@davemloft.net \
--cc=david.laight.linux@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=hangbin.liu@linux.dev \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@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
all inboxes | Powered by JetHome®