]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: protect devlink dump by the instance lock
authorJakub Kicinski <kuba@kernel.org>
Fri, 16 Dec 2022 04:41:22 +0000 (20:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:55 +0000 (13:32 +0100)
commit23cacdc7c621d3405b9c62b35b12fe7dbc2743df
treeb42672a93b1986e3eddf801ab968781fade8213b
parentb54d1120ad4330b2d408c00dcf59727b1cf4b76b
devlink: protect devlink dump by the instance lock

[ Upstream commit 214964a13ab56a9757d146b79b468a7ca190fbfb ]

Take the instance lock around devlink_nl_fill() when dumping,
doit takes it already.

We are only dumping basic info so in the worst case we were risking
data races around the reload statistics. Until the big devlink mutex
was removed all relevant code was protected by it, so the missing
instance lock was not exposed.

Fixes: 6da000fcde90 ("net: devlink: remove devlink_mutex")
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20221216044122.1863550-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/devlink.c