BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908 in_atomic(): 1, irqs_disabled(): 0, pid: 7806, name: syz-executor338 1 lock held by syz-executor338/7806: #0: 00000000eb3bd0a7 ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] #0: 00000000eb3bd0a7 ((&sp->resync_t)){+.-.}, at: call_timer_fn+0xda/0x720 kernel/time/timer.c:1316 Preemption disabled at: [] __do_softirq+0xf3/0x921 kernel/softirq.c:269 CPU: 0 PID: 7806 Comm: syz-executor338 Not tainted 4.19.88-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 ___might_sleep.cold+0x1bd/0x1f6 kernel/sched/core.c:6191 __might_sleep+0x95/0x190 kernel/sched/core.c:6144 __mutex_lock_common kernel/locking/mutex.c:908 [inline] __mutex_lock+0xc8/0x1300 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:123 resync_tnc+0x1b6/0x320 drivers/net/hamradio/6pack.c:522 call_timer_fn+0x18d/0x720 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers kernel/time/timer.c:1684 [inline] __run_timers kernel/time/timer.c:1652 [inline] run_timer_softirq+0x64f/0x16a0 kernel/time/timer.c:1697 __do_softirq+0x25c/0x921 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x13b/0x550 arch/x86/kernel/apic/apic.c:1094 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:893 RIP: 0033:0x444fc0 Code: c0 5b 5d c3 66 0f 1f 44 00 00 8b 04 24 48 83 c4 18 5b 5d c3 66 0f 1f 44 00 00 83 3d 31 d0 29 00 00 75 14 b8 23 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 64 1f fc ff c3 48 83 ec 08 e8 9a 42 00 00 RSP: 002b:00007ffddeb733c8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 0000000000002d77 RCX: 0000000000444fc0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffddeb733d0 RBP: 0000000000011e8d R08: 0000000000001e7e R09: 0000000001e48880 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004073b0 R13: 0000000000407440 R14: 0000000000000000 R15: 0000000000000000 ================================ WARNING: inconsistent lock state 4.19.88-syzkaller #0 Tainted: G W -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor338/7806 [HC0[0]:SC1[1]:HE1:SE0] takes: 000000007165adc8 (&tpk_port.port_write_mutex){+.?.}, at: tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:123 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3903 __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0xf7/0x1300 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:123 tnc_init drivers/net/hamradio/6pack.c:536 [inline] sixpack_open+0x9d3/0xbf5 drivers/net/hamradio/6pack.c:632 tty_ldisc_open.isra.0+0x89/0xd0 drivers/tty/tty_ldisc.c:462 tty_set_ldisc+0x2e3/0x690 drivers/tty/tty_ldisc.c:587 tiocsetd drivers/tty/tty_io.c:2359 [inline] tty_ioctl+0x65e/0x1510 drivers/tty/tty_io.c:2603 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688 ksys_ioctl+0xab/0xd0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe irq event stamp: 151266 hardirqs last enabled at (151266): [] trace_hardirqs_on_thunk+0x1a/0x1c hardirqs last disabled at (151265): [] trace_hardirqs_off_thunk+0x1a/0x1c softirqs last enabled at (147902): [] __do_softirq+0x633/0x921 kernel/softirq.c:318 softirqs last disabled at (151193): [] invoke_softirq kernel/softirq.c:372 [inline] softirqs last disabled at (151193): [] irq_exit+0x180/0x1d0 kernel/softirq.c:412 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tpk_port.port_write_mutex); lock(&tpk_port.port_write_mutex); *** DEADLOCK *** 1 lock held by syz-executor338/7806: #0: 00000000eb3bd0a7 ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] #0: 00000000eb3bd0a7 ((&sp->resync_t)){+.-.}, at: call_timer_fn+0xda/0x720 kernel/time/timer.c:1316 stack backtrace: CPU: 0 PID: 7806 Comm: syz-executor338 Tainted: G W 4.19.88-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_usage_bug.cold+0x330/0x42a kernel/locking/lockdep.c:2540 valid_state kernel/locking/lockdep.c:2553 [inline] mark_lock_irq kernel/locking/lockdep.c:2747 [inline] mark_lock+0xd1b/0x1370 kernel/locking/lockdep.c:3127 mark_irqflags kernel/locking/lockdep.c:3005 [inline] __lock_acquire+0xc62/0x49c0 kernel/locking/lockdep.c:3368 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3903 __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0xf7/0x1300 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:123 resync_tnc+0x1b6/0x320 drivers/net/hamradio/6pack.c:522 call_timer_fn+0x18d/0x720 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers kernel/time/timer.c:1684 [inline] __run_timers kernel/time/timer.c:1652 [inline] run_timer_softirq+0x64f/0x16a0 kernel/time/timer.c:1697 __do_softirq+0x25c/0x921 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x13b/0x550 arch/x86/kernel/apic/apic.c:1094 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:893 RIP: 0033:0x444fc0 Code: c0 5b 5d c3 66 0f 1f 44 00 00 8b 04 24 48 83 c4 18 5b 5d c3 66 0f 1f 44 00 00 83 3d 31 d0 29 00 00 75 14 b8 23 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 64 1f fc ff c3 48 83 ec 08 e8 9a 42 00 00 RSP: 002b:00007ffddeb733c8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 0000000000002d77 RCX: 0000000000444fc0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffddeb733d0 RBP: 0000000000011e8d R08: 0000000000001e7e R09: 0000000001e48880 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004073b0 R13: 0000000000407440 R14: 0000000000000000 R15: 0000000000000000 [U] `è BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908 in_atomic(): 1, irqs_disabled(): 0, pid: 17881, name: syz-executor338 INFO: lockdep is turned off. Preemption disabled at: [] mm_update_next_owner+0xdd/0x660 kernel/exit.c:429 CPU: 0 PID: 17881 Comm: syz-executor338 Tainted: G W 4.19.88-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 ___might_sleep.cold+0x1bd/0x1f6 kernel/sched/core.c:6191 __might_sleep+0x95/0x190 kernel/sched/core.c:6144 __mutex_lock_common kernel/locking/mutex.c:908 [inline] __mutex_lock+0xc8/0x1300 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:123 resync_tnc+0x1b6/0x320 drivers/net/hamradio/6pack.c:522 call_timer_fn+0x18d/0x720 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers kernel/time/timer.c:1684 [inline] __run_timers kernel/time/timer.c:1652 [inline] run_timer_softirq+0x64f/0x16a0 kernel/time/timer.c:1697 __do_softirq+0x25c/0x921 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x13b/0x550 arch/x86/kernel/apic/apic.c:1094 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:893 RIP: 0010:mm_update_next_owner+0x466/0x660 kernel/exit.c:453 Code: d3 fe ff ff e8 ab 4b 2b 00 4d 8d 84 24 20 04 00 00 4c 89 c0 48 c1 e8 03 80 3c 18 00 0f 85 14 01 00 00 4d 8b b4 24 20 04 00 00 <4d> 39 ee 75 90 e9 f4 fc ff ff e8 7b 4b 2b 00 48 c7 c7 c0 90 e0 88 RSP: 0018:ffff8882018d7d18 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 1ffff1101104acf4 RBX: dffffc0000000000 RCX: ffffffff813fc7ae RDX: 0000000000000000 RSI: ffffffff813fc855 RDI: ffff888088256a80 RBP: ffff8882018d7d78 R08: ffff8880882567a0 R09: fffffbfff11c1219 R10: fffffbfff11c1218 R11: ffffffff88e090c3 R12: ffff888088256380 R13: ffff8880a10f5900 R14: ffff8880a801a100 R15: ffff888087ed0540 exit_mm kernel/exit.c:545 [inline] do_exit+0x891/0x3080 kernel/exit.c:863 do_group_exit+0x135/0x370 kernel/exit.c:979 __do_sys_exit_group kernel/exit.c:990 [inline] __se_sys_exit_group kernel/exit.c:988 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:988 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x445398 Code: 00 00 be 3c 00 00 00 eb 19 66 0f 1f 84 00 00 00 00 00 48 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 77 21 f4 48 89 d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e0 f7 d8 64 41 89 01 eb d8 0f 1f 84 00 00 00 RSP: 002b:00007ffddeb733a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445398 RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 RBP: 00000000004cc9b0 R08: 00000000000000e7 R09: ffffffffffffffd0 R10: 00007ffddeb733f0 R11: 0000000000000246 R12: 0000000000000001 R13: 00000000006e0320 R14: 0000000000000004 R15: 0000000000000001 [U] `è