Re: [syzbot] [wireguard?] WARNING in kthread_unpark (2)

From: Hillf Danton
Date: Tue Jul 30 2024 - 06:37:04 EST


On Mon, 29 Jul 2024 08:48:30 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: dc1c8034e31b minmax: simplify min()/max()/clamp() implemen..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1022b573980000

#syz test upstream dc1c8034e31b

--- x/kernel/workqueue.c
+++ y/kernel/workqueue.c
@@ -2679,7 +2679,8 @@ static void worker_attach_to_pool(struct
worker->flags |= WORKER_UNBOUND;
} else {
WARN_ON_ONCE(pool->flags & POOL_BH);
- kthread_set_per_cpu(worker->task, pool->cpu);
+ if (!worker->rescue_wq)
+ kthread_set_per_cpu(worker->task, pool->cpu);
}

if (worker->rescue_wq)
--