linux/net/netlink
Eric Dumazet 1f62c25f24 netlink: hold nlk->cb_mutex longer in __netlink_dump_start()
[ Upstream commit b559027006 ]

__netlink_dump_start() releases nlk->cb_mutex right before
calling netlink_dump() which grabs it again.

This seems dangerous, even if KASAN did not bother yet.

Add a @lock_taken parameter to netlink_dump() to let it
grab the mutex if called from netlink_recvmsg() only.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-08-29 17:30:36 +02:00
..
af_netlink.c netlink: hold nlk->cb_mutex longer in __netlink_dump_start() 2024-08-29 17:30:36 +02:00
af_netlink.h netlink: convert nlk->flags to atomic flags 2023-09-23 11:11:02 +02:00
diag.c netlink: convert nlk->flags to atomic flags 2023-09-23 11:11:02 +02:00
genetlink.c drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group 2023-12-13 18:39:12 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile netlink: add infrastructure to expose policies to userspace 2020-04-30 17:51:42 -07:00
policy.c net: genl: fix error path memory leak in policy dumping 2022-08-18 10:20:48 -07:00