From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Xuanqiang Luo <xuanqiang.luo@linux.dev>,
linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
paul@pbarker.dev, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, richardcochran@gmail.com,
masaru.nagai.vx@renesas.com, sergei.shtylyov@cogentembedded.com,
Xuanqiang Luo <luoxuanqiang@kylinos.cn>,
stable@vger.kernel.org
Subject: Re: [PATCH net v2] net: ravb: fix use-after-free in ravb_get_ts_info
Date: Wed, 5 Aug 2026 10:40:27 +0200 [thread overview]
Message-ID: <20260805084027.GF346309@ragnatech.se> (raw)
In-Reply-To: <20260804180855.75f6c91c@kernel.org>
On 2026-08-04 18:08:55 -0700, Jakub Kicinski wrote:
> On Sun, 2 Aug 2026 14:17:27 +0200 Niklas Söderlund wrote:
> > > The PHC is registered by ravb_open() and unregistered by ravb_close().
> > > However, ravb_ptp_stop() leaves priv->ptp.clock pointing at the freed
> > > clock. Since the netdev remains registered after ndo_stop, get_ts_info
> > > can still pass the dangling pointer to ptp_clock_index(), resulting in a
> > > use-after-free.
> > >
> > > Clear the pointer after unregistering the clock and only advertise hardware
> > > timestamping support when a PHC is available.
> > >
> > > Fixes: a0d2f20650e8 ("Renesas Ethernet AVB PTP clock driver")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
> >
> > Thanks for re spinning this,
>
> The AI reivewer has more comments, but at high level - why unregister
> the PHC when the device goes down? The clocks stop?
Yes, PTP clock is in the same power domain as the ndev. When the device
go down runtime PM suspends the device so the clock also stops.
--
Kind Regards,
Niklas Söderlund
next prev parent reply other threads:[~2026-08-05 8:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 9:07 [PATCH net v2] net: ravb: fix use-after-free in ravb_get_ts_info Xuanqiang Luo
2026-08-02 12:17 ` Niklas Söderlund
2026-08-05 1:08 ` Jakub Kicinski
2026-08-05 8:40 ` Niklas Söderlund [this message]
2026-08-05 1:06 ` Jakub Kicinski
2026-08-05 8:36 ` Niklas Söderlund
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=20260805084027.GF346309@ragnatech.se \
--to=niklas.soderlund@ragnatech.se \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=luoxuanqiang@kylinos.cn \
--cc=masaru.nagai.vx@renesas.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paul@pbarker.dev \
--cc=richardcochran@gmail.com \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=stable@vger.kernel.org \
--cc=xuanqiang.luo@linux.dev \
/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