BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908 in_atomic(): 1, irqs_disabled(): 0, pid: 8166, name: syz-fuzzer 1 lock held by syz-fuzzer/8166: #0: 00000000e1f436b8 ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] #0: 00000000e1f436b8 ((&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: 1 PID: 8166 Comm: syz-fuzzer Not tainted 4.19.100-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:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 __mutex_lock_common kernel/locking/mutex.c:908 [inline] __mutex_lock+0xc8/0x1300 kernel/locking/mutex.c:1072 netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. 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 device veth1169 entered promiscuous mode 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 IPv6: ADDRCONF(NETDEV_UP): veth1169: link is not ready RIP: 0033:0x412e49 Code: d3 e0 48 83 f9 40 4d 19 c9 4d 21 c8 49 ff c8 4d 21 c4 31 d2 45 31 c0 49 89 c9 48 85 d2 0f 84 e3 02 00 00 44 0f b6 32 48 ff c2 08 00 00 00 49 39 f5 0f 85 9c 02 00 00 48 8b 73 08 48 c1 ee 03 RSP: 002b:000000c43a2c4280 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 000000000085da20 RCX: 0000000000000000 RDX: 00000000009e7397 RSI: 0000000000000020 RDI: 000000c41ee15b80 RBP: 000000c43a2c42c8 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000009e7396 R11: 0000000000000020 R12: 0000000000000000 R13: 0000000000000020 R14: 0000000000000003 R15: 0000000000000100 ================================ WARNING: inconsistent lock state 4.19.100-syzkaller #0 Tainted: G W -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-fuzzer/8166 [HC0[0]:SC1[1]:HE1:SE0] takes: 000000009893a4db (&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_close+0x50/0x95 drivers/char/ttyprintk.c:104 tty_release+0x3ba/0xe90 drivers/tty/tty_io.c:1678 __fput+0x2dd/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe irq event stamp: 16966612 hardirqs last enabled at (16966612): [] trace_hardirqs_on_thunk+0x1a/0x1c hardirqs last disabled at (16966611): [] trace_hardirqs_off_thunk+0x1a/0x1c softirqs last enabled at (16966496): [] __do_softirq+0x633/0x921 kernel/softirq.c:318 softirqs last disabled at (16966539): [] invoke_softirq kernel/softirq.c:372 [inline] softirqs last disabled at (16966539): [] 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-fuzzer/8166: #0: 00000000e1f436b8 ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] #0: 00000000e1f436b8 ((&sp->resync_t)){+.-.}, at: call_timer_fn+0xda/0x720 kernel/time/timer.c:1316 stack backtrace: CPU: 1 PID: 8166 Comm: syz-fuzzer Tainted: G W 4.19.100-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:0x412e49 Code: d3 e0 48 83 f9 40 4d 19 c9 4d 21 c8 49 ff c8 4d 21 c4 31 d2 45 31 c0 49 89 c9 48 85 d2 0f 84 e3 02 00 00 44 0f b6 32 48 ff c2 08 00 00 00 49 39 f5 0f 85 9c 02 00 00 48 8b 73 08 48 c1 ee 03 RSP: 002b:000000c43a2c4280 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 000000000085da20 RCX: 0000000000000000 RDX: 00000000009e7397 RSI: 0000000000000020 RDI: 000000c41ee15b80 RBP: 000000c43a2c42c8 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000009e7396 R11: 0000000000000020 R12: 0000000000000000 R13: 0000000000000020 R14: 0000000000000003 R15: 0000000000000100 batman_adv: batadv0: Adding interface: veth1169 batman_adv: batadv0: The MTU of interface veth1169 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1169 (retrying later): interface not active nla_parse: 2 callbacks suppressed netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. device veth1171 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1171 batman_adv: batadv0: The MTU of interface veth1171 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1171 (retrying later): interface not active netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. IPv6: ADDRCONF(NETDEV_UP): veth1171: link is not ready batman_adv: batadv0: Interface activated: veth1171 netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. batman_adv: batadv0: Interface deactivated: veth1171 netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. device veth1173 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1173 batman_adv: batadv0: The MTU of interface veth1173 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1173 (retrying later): interface not active netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. IPv6: ADDRCONF(NETDEV_UP): veth1173: link is not ready batman_adv: batadv0: Interface activated: veth1173 netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. device veth1175 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1175 batman_adv: batadv0: The MTU of interface veth1175 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1175 (retrying later): interface not active IPv6: ADDRCONF(NETDEV_UP): veth1175: link is not ready batman_adv: batadv0: Interface activated: veth1175 device veth1177 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1177 batman_adv: batadv0: The MTU of interface veth1177 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1177 (retrying later): interface not active IPv6: ADDRCONF(NETDEV_UP): veth1177: link is not ready batman_adv: batadv0: Interface activated: veth1177 batman_adv: batadv0: Interface deactivated: veth1177 device veth1179 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1179 batman_adv: batadv0: The MTU of interface veth1179 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1179 (retrying later): interface not active IPv6: ADDRCONF(NETDEV_UP): veth1179: link is not ready batman_adv: batadv0: Interface activated: veth1179 batman_adv: batadv0: Interface deactivated: veth1179 nla_parse: 13 callbacks suppressed netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908 in_atomic(): 1, irqs_disabled(): 0, pid: 8153, name: syz-fuzzer INFO: lockdep is turned off. Preemption disabled at: [] __do_softirq+0xf3/0x921 kernel/softirq.c:269 CPU: 1 PID: 8153 Comm: syz-fuzzer Tainted: G W 4.19.100-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:6192 __might_sleep+0x95/0x190 kernel/sched/core.c:6145 __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:0x6f67fb Code: 48 89 04 24 48 8b 8c 24 10 01 00 00 48 89 4c 24 08 48 8b 94 24 38 01 00 00 48 8b 1a ff d3 48 8b bc 24 a0 00 00 00 0f b6 47 18 <84> c0 0f 85 20 03 00 00 48 8b 8c 24 08 01 00 00 48 85 c9 0f 84 7e RSP: 002b:000000c43a2c45b8 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 000000000000000c RCX: 000000c43a2c47a8 RDX: 00000000008bd542 RSI: 000000c4390725c0 RDI: 000000c439074520 RBP: 000000c43a2c46b0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000009e7396 R11: 0000000000000004 R12: 0000000000000000 R13: 0000000000000020 R14: 0000000000000013 R15: 0000000000000100 netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. device veth1181 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1181 batman_adv: batadv0: The MTU of interface veth1181 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1181 (retrying later): interface not active netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. device veth1183 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1183 batman_adv: batadv0: The MTU of interface veth1183 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1183 (retrying later): interface not active netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 13 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.4'. device veth1185 entered promiscuous mode batman_adv: batadv0: Adding interface: veth1185 batman_adv: batadv0: The MTU of interface veth1185 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface veth1185 (retrying later): interface not active device veth1187 entered promiscuous mode