linux-stable/net/devlink
Moshe Shemesh aba0e909dc devlink: Hold devlink lock on health reporter dump get
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>
2023-10-06 15:56:46 -07:00
..
core.c devlink: move tracepoint definitions into core.c 2023-08-28 08:02:23 -07:00
dev.c devlink: move devlink_notify_register/unregister() to dev.c 2023-08-28 08:02:24 -07:00
devl_internal.h devlink: move devlink_notify_register/unregister() to dev.c 2023-08-28 08:02:24 -07:00
dpipe.c devlink: push dpipe related code into separate file 2023-08-28 08:02:22 -07:00
health.c devlink: Hold devlink lock on health reporter dump get 2023-10-06 15:56:46 -07:00
linecard.c devlink: push linecard related code into separate file 2023-08-28 08:02:23 -07:00
Makefile devlink: move devlink_notify_register/unregister() to dev.c 2023-08-28 08:02:24 -07:00
netlink.c devlink: move small_ops definition into netlink.c 2023-08-28 08:02:23 -07:00
netlink_gen.c netlink: specs: devlink: extend health reporter dump attributes by port index 2023-08-14 11:47:25 -07:00
netlink_gen.h netlink: specs: devlink: add commands that do per-instance dump 2023-08-14 11:47:25 -07:00
param.c devlink: push param related code into separate file 2023-08-28 08:02:22 -07:00
port.c devlink: push port related code into separate file 2023-08-28 08:02:22 -07:00
rate.c devlink: push rate related code into separate file 2023-08-28 08:02:23 -07:00
region.c devlink: push region related code into separate file 2023-08-28 08:02:23 -07:00
resource.c devlink: push resource related code into separate file 2023-08-28 08:02:22 -07:00
sb.c devlink: push shared buffer related code into separate file 2023-08-28 08:02:22 -07:00
trap.c devlink: push trap related code into separate file 2023-08-28 08:02:23 -07:00