BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908 in_atomic(): 1, irqs_disabled(): 0, pid: 13397, name: blkid 2 locks held by blkid/13397: #0: 00000000b6aa3e78 (&mm->mmap_sem){++++}, at: __do_page_fault+0x3c9/0xe90 arch/x86/mm/fault.c:1319 #1: 0000000081ff46cc ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] #1: 0000000081ff46cc ((&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: 13397 Comm: blkid 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 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:__sanitizer_cov_trace_pc+0x26/0x50 kernel/kcov.c:101 Code: 90 90 90 90 55 48 89 e5 48 8b 75 08 65 48 8b 04 25 40 ee 01 00 65 8b 15 28 e9 96 7e 81 e2 00 01 1f 00 75 2b 8b 90 d0 12 00 00 <83> fa 02 75 20 48 8b 88 d8 12 00 00 8b 80 d4 12 00 00 48 8b 11 48 RSP: 0000:ffff888034697e28 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffff888041e76000 RBX: 0000000000000001 RCX: ffffffff81302414 RDX: 0000000000000000 RSI: ffffffff81302421 RDI: 0000000000000005 RBP: ffff888034697e28 R08: ffff888041e76000 R09: 0000000000000000 R10: ffff888041e76880 R11: 0000000037363326 R12: 00007fb99acce6f0 R13: ffff888034697f58 R14: ffff8880457b7880 R15: 0000000000000000 __do_page_fault+0x3e1/0xe90 arch/x86/mm/fault.c:1333 do_page_fault+0x71/0x57d arch/x86/mm/fault.c:1465 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1204 RIP: 0033:0x7fb99acce6f0 Code: Bad RIP value. RSP: 002b:00007ffdb78065f8 EFLAGS: 00010202 RAX: 0000000000000004 RBX: 0000000000000000 RCX: 0000000001fac0a8 RDX: 00007fb99aee2cd8 RSI: 00000000000001ea RDI: 0000000001fac030 RBP: 00007ffdb7807f2a R08: 0000000000000078 R09: 0000000001680000 R10: 0000000000000000 R11: 00007fb99acce6f0 R12: 0000000001fac030 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000005 ================================ WARNING: inconsistent lock state 4.19.100-syzkaller #0 Tainted: G W -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. blkid/13397 [HC0[0]:SC1[1]:HE1:SE0] takes: 000000005600d0a4 (&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: 2426 hardirqs last enabled at (2426): [] trace_hardirqs_on_thunk+0x1a/0x1c hardirqs last disabled at (2425): [] trace_hardirqs_off_thunk+0x1a/0x1c softirqs last enabled at (1166): [] __do_softirq+0x633/0x921 kernel/softirq.c:318 softirqs last disabled at (2305): [] invoke_softirq kernel/softirq.c:372 [inline] softirqs last disabled at (2305): [] 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 *** 2 locks held by blkid/13397: #0: 00000000b6aa3e78 (&mm->mmap_sem){++++}, at: __do_page_fault+0x3c9/0xe90 arch/x86/mm/fault.c:1319 #1: 0000000081ff46cc ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline] #1: 0000000081ff46cc ((&sp->resync_t)){+.-.}, at: call_timer_fn+0xda/0x720 kernel/time/timer.c:1316 stack backtrace: CPU: 1 PID: 13397 Comm: blkid 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: 0010:__sanitizer_cov_trace_pc+0x26/0x50 kernel/kcov.c:101 Code: 90 90 90 90 55 48 89 e5 48 8b 75 08 65 48 8b 04 25 40 ee 01 00 65 8b 15 28 e9 96 7e 81 e2 00 01 1f 00 75 2b 8b 90 d0 12 00 00 <83> fa 02 75 20 48 8b 88 d8 12 00 00 8b 80 d4 12 00 00 48 8b 11 48 RSP: 0000:ffff888034697e28 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffff888041e76000 RBX: 0000000000000001 RCX: ffffffff81302414 RDX: 0000000000000000 RSI: ffffffff81302421 RDI: 0000000000000005 RBP: ffff888034697e28 R08: ffff888041e76000 R09: 0000000000000000 R10: ffff888041e76880 R11: 0000000037363326 R12: 00007fb99acce6f0 R13: ffff888034697f58 R14: ffff8880457b7880 R15: 0000000000000000 __do_page_fault+0x3e1/0xe90 arch/x86/mm/fault.c:1333 do_page_fault+0x71/0x57d arch/x86/mm/fault.c:1465 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1204 RIP: 0033:0x7fb99acce6f0 Code: Bad RIP value. RSP: 002b:00007ffdb78065f8 EFLAGS: 00010202 RAX: 0000000000000004 RBX: 0000000000000000 RCX: 0000000001fac0a8 RDX: 00007fb99aee2cd8 RSI: 00000000000001ea RDI: 0000000001fac030 RBP: 00007ffdb7807f2a R08: 0000000000000078 R09: 0000000001680000 R10: 0000000000000000 R11: 00007fb99acce6f0 R12: 0000000001fac030 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000005 tmpfs: Bad value 'prefer%' for mount option 'mpol' device vlan0 entered promiscuous mode ntfs: (device loop4): parse_options(): Unrecognized mount option disable_spe. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 tmpfs: Bad value 'prefer%' for mount option 'mpol' SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 tmpfs: Bad value 'prefer%' for mount option 'mpol' SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=13473 comm=syz-executor.3 tmpfs: Bad value 'prefer%' for mount option 'mpol' tmpfs: Bad value 'prefer%' for mount option 'mpol' tmpfs: Bad value 'prefer%' for mount option 'mpol' tmpfs: Bad value 'prefer%' for mount option 'mpol' tmpfs: Bad value 'prefer%' for mount option 'mpol' __ntfs_error: 5 callbacks suppressed ntfs: (device loop4): parse_options(): Unrecognized mount option disable_spe. ntfs: (device loop4): parse_options(): Invalid gid option argument: [O%- [Ai~] __do_softirq+0xf3/0x921 kernel/softirq.c:269 CPU: 1 PID: 13802 Comm: blkid 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:0x7f7ef02968aa Code: 85 db 0f 84 69 ff ff ff 4c 89 c2 4c 89 c0 89 db 48 c1 fa 3f 48 f7 fb 49 89 c0 e9 70 ff ff ff 90 89 f9 44 89 c0 83 c7 01 0f a2 <81> e3 ff 00 00 00 81 e1 f0 0f 00 00 0f 84 52 fe ff ff 85 db 0f 84 RSP: 002b:00007ffd3910c750 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000100 RDX: 0000000000000001 RSI: 0000000002d00000 RDI: 0000000000000001 RBP: 0000000000008000 R08: 000000000000000b R09: 0000000000000001 R10: 000000000000000d R11: 0000000000000001 R12: 00007f7ef049dba8 R13: 00007ffd3910c838 R14: 0000000000000001 R15: 0000000000000001 tmpfs: Bad value 'prefer%' for mount option 'mpol' tmpfs: No value for mount option 'm' device vlan0 entered promiscuous mode