Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
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: Tue, 4 Aug 2026 18:08:55 -0700	[thread overview]
Message-ID: <20260804180855.75f6c91c@kernel.org> (raw)
In-Reply-To: <20260802121727.GA2716708@ragnatech.se>

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?

  reply	other threads:[~2026-08-05  1:08 UTC|newest]

Thread overview: 7+ 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 [this message]
2026-08-05  8:40     ` Niklas Söderlund
2026-08-05  1:06 ` Jakub Kicinski
2026-08-05  8:36   ` Niklas Söderlund
2026-08-05 23:30     ` Jakub Kicinski

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=20260804180855.75f6c91c@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=luoxuanqiang@kylinos.cn \
    --cc=masaru.nagai.vx@renesas.com \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --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