BUG: sleeping function called from invalid context at kernel/task_work.c:181 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3553, name: udevd preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 no locks held by udevd/3553. Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 3553 Comm: udevd Not tainted 6.1.78-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 __might_resched+0x5cb/0x780 kernel/sched/core.c:9942 task_work_run+0x26d/0x300 kernel/task_work.c:181 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f89fbd16ab9 Code: 00 00 00 44 8b 54 24 58 48 89 44 24 30 48 8d 44 24 40 48 89 44 24 38 64 8b 04 25 18 00 00 00 85 c0 75 21 b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 6f 48 8b 15 40 a3 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffd23e0f350 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: fffffffffffffffe RBX: 00007ffd23e114b0 RCX: 00007f89fbd16ab9 RDX: 0000000000080000 RSI: 00007f89fc235dd8 RDI: 000000000000000b RBP: 0000562f8ff1e950 R08: 0000562f8ff10240 R09: 00007f89fbdf1b20 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000b R13: 00007f89fc235dd8 R14: 0000000000080000 R15: 0000000000000001 BUG: scheduling while atomic: udevd/3553/0x00000002 no locks held by udevd/3553. Modules linked in: Preemption disabled at: [<0000000000000000>] 0x0