netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: idosch@idosch.org
Cc: netdev@vger.kernel.org, jiri@mellanox.com, mlxsw@mellanox.com,
	idosch@mellanox.com
Subject: Re: [PATCH net] mlxsw: spectrum_acl: Fix use-after-free during reload
Date: Thu, 23 Jan 2020 11:34:31 +0100 (CET)	[thread overview]
Message-ID: <20200123.113431.1301491947389006898.davem@davemloft.net> (raw)
In-Reply-To: <20200122180952.262582-1-idosch@idosch.org>

From: Ido Schimmel <idosch@idosch.org>
Date: Wed, 22 Jan 2020 20:09:52 +0200

> From: Ido Schimmel <idosch@mellanox.com>
> 
> During reload (or module unload), the router block is de-initialized.
> Among other things, this results in the removal of a default multicast
> route from each active virtual router (VRF). These default routes are
> configured during initialization to trap packets to the CPU. In
> Spectrum-2, unlike Spectrum-1, multicast routes are implemented using
> ACL rules.
> 
> Since the router block is de-initialized before the ACL block, it is
> possible that the ACL rules corresponding to the default routes are
> deleted while being accessed by the ACL delayed work that queries rules'
> activity from the device. This can result in a rare use-after-free [1].
> 
> Fix this by protecting the rules list accessed by the delayed work with
> a lock. We cannot use a spinlock as the activity read operation is
> blocking.
 ...
> Fixes: cf7221a4f5a5 ("mlxsw: spectrum_router: Add Multicast routing support for Spectrum-2")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Acked-by: Jiri Pirko <jiri@mellanox.com>

Applied and queued up for -stable, thanks.

      reply	other threads:[~2020-01-23 10:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 18:09 [PATCH net] mlxsw: spectrum_acl: Fix use-after-free during reload Ido Schimmel
2020-01-23 10:34 ` David Miller [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=20200123.113431.1301491947389006898.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=idosch@idosch.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).