]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mlxsw: core: Increase scope of RCU read-side critical section
authorIdo Schimmel <idosch@mellanox.com>
Wed, 29 Jul 2020 09:26:45 +0000 (12:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:44 +0000 (09:58 +0200)
commit94a4279be84b9ab7d150334a1f1d9cad65a2f9fa
treeed587e7ae7d0304e2b9164117927e245e0ec0299
parent02963f5752032ab987fae7b450d5e1e357e7425b
mlxsw: core: Increase scope of RCU read-side critical section

[ Upstream commit 7d8e8f3433dc8d1dc87c1aabe73a154978fb4c4d ]

The lifetime of the Rx listener item ('rxl_item') is managed using RCU,
but is dereferenced outside of RCU read-side critical section, which can
lead to a use-after-free.

Fix this by increasing the scope of the RCU read-side critical section.

Fixes: 93c1edb27f9e ("mlxsw: Introduce Mellanox switch driver core")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core.c