linux-stable/net/devlink
Moshe Shemesh f776656844 devlink: Hold devlink lock on health reporter dump get
[ Upstream commit aba0e909dc ]

Devlink health dump get callback should take devlink lock as any other
devlink callback. Otherwise, since devlink_mutex was removed, this
callback is not protected from a race of the reporter being destroyed
while handling the callback.

Add devlink lock to the callback and to any call for
devlink_health_do_dump(). This should be safe as non of the drivers dump
callback implementation takes devlink lock.

As devlink lock is added to any callback of dump, the reporter dump_lock
is now redundant and can be removed.

Fixes: d3efc2a6a6 ("net: devlink: remove devlink_mutex")
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://lore.kernel.org/r/1696510216-189379-1-git-send-email-moshe@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-19 23:10:59 +02:00
..
core.c devlink: Fix crash with CONFIG_NET_NS=n 2023-05-16 19:57:52 -07:00
dev.c
devl_internal.h devlink: change per-devlink netdev notifier to static one 2023-05-11 18:06:50 -07:00
health.c devlink: Hold devlink lock on health reporter dump get 2023-10-19 23:10:59 +02:00
leftover.c devlink: remove reload failed checks in params get/set callbacks 2023-09-23 11:14:19 +02:00
Makefile
netlink.c