Subject: Re: [PATCH v2 net-next 06/14] netlink: hold nlk->cb_mutex longer in __netlink_dump_start()

From: Jiri Pirko <[email-masked]>
Date: Thu, 22 Feb 2024 17:20:25 +0100

Thu, Feb 22, 2024 at 11:50:13AM CET, [email-masked] wrote:
>__netlink_dump_start() releases nlk->cb_mutex right before
>calling netlink_dump() which grabs it again.

Yeah, I spotted this recently as well. Good to get rid of it.

>
>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 <[email-masked]>

Reviewed-by: Jiri Pirko <[email-masked]>