BUG: sleeping function called from invalid context at kernel/locking/mutex.c:580 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 17325, name: syz-executor.2 preempt_count: 100, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [] softirq_handle_begin kernel/softirq.c:409 [inline] [] __do_softirq+0xe3/0xad8 kernel/softirq.c:547 CPU: 0 PID: 17325 Comm: syz-executor.2 Not tainted 6.1.0-rc1-syzkaller-00249-g4da34b7d175d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9890 __mutex_lock_common kernel/locking/mutex.c:580 [inline] __mutex_lock+0x9f/0x1350 kernel/locking/mutex.c:747 gsm_send.isra.0+0x41e/0x7e0 drivers/tty/n_gsm.c:724 gsm_command drivers/tty/n_gsm.c:788 [inline] gsm_dlci_begin_close+0x12e/0x210 drivers/tty/n_gsm.c:1930 gsm_dlci_t1+0x186/0x450 drivers/tty/n_gsm.c:1854 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:__sanitizer_cov_trace_const_cmp4+0xd/0x20 kernel/kcov.c:304 Code: 24 0f b7 d6 0f b7 f7 bf 03 00 00 00 e9 bc fe ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 90 48 8b 0c 24 89 f2 89 fe bf 05 00 00 00 9e fe ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 8b 0c RSP: 0018:ffffc900049cfa38 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff888147469000 RCX: ffffffff849542a0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005 RBP: dffffc0000000000 R08: 0000000000000004 R09: 00000000003000c9 R10: 000000000ef00026 R11: 000000000008c07e R12: ffffc900049cfa68 R13: ffffc900049cfb20 R14: ffffffff84934110 R15: 0000000000000000 class_find_device+0x200/0x2a0 drivers/base/class.c:416 class_find_device_by_devt include/linux/device/class.h:167 [inline] device_destroy+0x79/0xd0 drivers/base/core.c:4299 tty_unregister_device+0x7e/0x1b0 drivers/tty/tty_io.c:3291 gsm_unregister_devices drivers/tty/n_gsm.c:580 [inline] gsm_cleanup_mux+0x5c1/0x800 drivers/tty/n_gsm.c:2503 gsmld_close+0x41/0x210 drivers/tty/n_gsm.c:2945 tty_ldisc_close+0x110/0x190 drivers/tty/tty_ldisc.c:456 tty_ldisc_kill+0x94/0x150 drivers/tty/tty_ldisc.c:608 tty_ldisc_release+0x1ef/0x2a0 drivers/tty/tty_ldisc.c:776 tty_release_struct+0x20/0xe0 drivers/tty/tty_io.c:1687 tty_release+0xc10/0x11b0 drivers/tty/tty_io.c:1858 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16b/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:296 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f7c7de3d3cb Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007f7c7e4dfb80 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00007f7c7de3d3cb RDX: 00007f7c7dfb04b0 RSI: ffffffffffffffff RDI: 0000000000000004 RBP: 00007f7c7dfad980 R08: 0000000000000000 R09: 00007f7c7dfb04b8 R10: 00007f7c7e4dfc80 R11: 0000000000000293 R12: 0000000000077254 R13: 00007f7c7e4dfc80 R14: 00007f7c7dfac050 R15: 0000000000000032 ---------------- Code disassembly (best guess): 0: 24 0f and $0xf,%al 2: b7 d6 mov $0xd6,%bh 4: 0f b7 f7 movzwl %di,%esi 7: bf 03 00 00 00 mov $0x3,%edi c: e9 bc fe ff ff jmpq 0xfffffecd 11: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 18: 00 00 00 00 1c: 90 nop 1d: 48 8b 0c 24 mov (%rsp),%rcx 21: 89 f2 mov %esi,%edx 23: 89 fe mov %edi,%esi 25: bf 05 00 00 00 mov $0x5,%edi * 2a: e9 9e fe ff ff jmpq 0xfffffecd <-- trapping instruction 2f: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 36: 00 00 00 00 3a: 0f 1f 00 nopl (%rax) 3d: 48 rex.W 3e: 8b .byte 0x8b 3f: 0c .byte 0xc