netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev,
	arkadiusz.kubalewski@intel.com, saeedm@nvidia.com,
	leon@kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com
Subject: Re: [patch net] net/mlx5: DPLL, Fix possible use after free after delayed work timer triggers
Date: Thu, 8 Feb 2024 15:05:50 +0000	[thread overview]
Message-ID: <20240208150550.GK1435458@kernel.org> (raw)
In-Reply-To: <20240206164328.360313-1-jiri@resnulli.us>

On Tue, Feb 06, 2024 at 05:43:28PM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> I managed to hit following use after free warning recently:

...

> I didn't manage to reproduce it. Though the issue seems to be obvious.
> There is a chance that the mlx5_dpll_remove() calls
> cancel_delayed_work() when the work runs and manages to re-arm itself.
> In that case, after delay timer triggers next attempt to queue it,
> it works with freed memory.
> 
> Fix this by using cancel_delayed_work_sync() instead which makes sure
> that work is done when it returns.
> 
> Fixes: 496fd0a26bbf ("mlx5: Implement SyncE support using DPLL infrastructure")
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2024-02-08 15:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 16:43 [patch net] net/mlx5: DPLL, Fix possible use after free after delayed work timer triggers Jiri Pirko
2024-02-08 15:05 ` Simon Horman [this message]
2024-02-09  2:50 ` patchwork-bot+netdevbpf

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=20240208150550.GK1435458@kernel.org \
    --to=horms@kernel.org \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=vadim.fedorenko@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;
as well as URLs for NNTP newsgroup(s).