Re: [PATCH net v3] netconsole: Fix race condition in between reader and writer of userdata

From: Gustavo Luiz Duarte

Date: Tue Oct 28 2025 - 17:28:54 EST


On Mon, Oct 27, 2025 at 4:08 PM Gustavo Luiz Duarte <gustavold@xxxxxxxxx> wrote:
> @@ -888,6 +888,9 @@ static void update_userdata(struct netconsole_target *nt)
> {
> int complete_idx = 0, child_count = 0;
> struct list_head *entry;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&target_list_lock, flags);

I realize that we might call WARN_ON_ONCE() while holding this
spinlock, which could deadlock trying to write to netconsole.
Let me send v4 addressing that.