From: Simon Horman <horms@kernel.org>
To: Petr Machata <petrm@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
netdev@vger.kernel.org, Ido Schimmel <idosch@nvidia.com>,
mlxsw@nvidia.com, Jiri Pirko <jiri@resnulli.us>
Subject: Re: [PATCH net 3/3] mlxsw: spectrum_mr: Fix use-after-free when updating multicast route stats
Date: Wed, 3 Dec 2025 17:55:40 +0000 [thread overview]
Message-ID: <aTB5nBUI6a3YBRlr@horms.kernel.org> (raw)
In-Reply-To: <f996feecfd59fde297964bfc85040b6d83ec6089.1764695650.git.petrm@nvidia.com>
On Tue, Dec 02, 2025 at 06:44:13PM +0100, Petr Machata wrote:
> From: Ido Schimmel <idosch@nvidia.com>
>
> Cited commit added a dedicated mutex (instead of RTNL) to protect the
> multicast route list, so that it will not change while the driver
> periodically traverses it in order to update the kernel about multicast
> route stats that were queried from the device.
>
> One instance of list entry deletion (during route replace) was missed
> and it can result in a use-after-free [1].
>
> Fix by acquiring the mutex before deleting the entry from the list and
> releasing it afterwards.
...
> Fixes: f38656d06725 ("mlxsw: spectrum_mr: Protect multicast route list with a lock")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Petr Machata <petrm@nvidia.com>
> Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2025-12-03 17:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 17:44 [PATCH net 0/3] mlxsw: Three (m)router fixes Petr Machata
2025-12-02 17:44 ` [PATCH net 1/3] mlxsw: spectrum_router: Fix possible neighbour reference count leak Petr Machata
2025-12-03 17:54 ` Simon Horman
2025-12-02 17:44 ` [PATCH net 2/3] mlxsw: spectrum_router: Fix neighbour use-after-free Petr Machata
2025-12-03 17:55 ` Simon Horman
2025-12-02 17:44 ` [PATCH net 3/3] mlxsw: spectrum_mr: Fix use-after-free when updating multicast route stats Petr Machata
2025-12-03 17:55 ` Simon Horman [this message]
2025-12-05 3:20 ` [PATCH net 0/3] mlxsw: Three (m)router fixes 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=aTB5nBUI6a3YBRlr@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.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;
as well as URLs for NNTP newsgroup(s).