The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Duoming Zhou <duoming@zju.edu.cn>, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kuba@kernel.org,
	edumazet@google.com, davem@davemloft.net, andrew+netdev@lunn.ch,
	UNGLinuxDriver@microchip.com, alexandre.belloni@bootlin.com,
	claudiu.manoil@nxp.com, vladimir.oltean@nxp.com
Subject: Re: [PATCH net] net: mscc: ocelot: Fix use-after-free caused by cyclic delayed work
Date: Tue, 30 Sep 2025 13:13:48 +0200	[thread overview]
Message-ID: <052f3394-ce15-4e6c-bfe2-4dfbee25be29@redhat.com> (raw)
In-Reply-To: <20250927144514.8847-1-duoming@zju.edu.cn>

On 9/27/25 4:45 PM, Duoming Zhou wrote:
> diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c
> index 545710dadcf5..d8ab789f6bea 100644
> --- a/drivers/net/ethernet/mscc/ocelot_stats.c
> +++ b/drivers/net/ethernet/mscc/ocelot_stats.c
> @@ -1021,6 +1021,6 @@ int ocelot_stats_init(struct ocelot *ocelot)
>  
>  void ocelot_stats_deinit(struct ocelot *ocelot)
>  {
> -	cancel_delayed_work(&ocelot->stats_work);
> +	cancel_delayed_work_sync(&ocelot->stats_work);
>  	destroy_workqueue(ocelot->stats_queue);
>  }

AFAICS the stat_work can unconditionally reschedule itself, you should
use disable_delayed_work_sync() instead.

Cheers,

Paolo


      reply	other threads:[~2025-09-30 11:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-27 14:45 [PATCH net] net: mscc: ocelot: Fix use-after-free caused by cyclic delayed work Duoming Zhou
2025-09-30 11:13 ` Paolo Abeni [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=052f3394-ce15-4e6c-bfe2-4dfbee25be29@redhat.com \
    --to=pabeni@redhat.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=duoming@zju.edu.cn \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vladimir.oltean@nxp.com \
    /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