BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 20484, name: blkid 3 locks held by blkid/20484: #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pte_range mm/memory.c:1038 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pmd_range mm/memory.c:1184 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pud_range mm/memory.c:1213 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_p4d_range mm/memory.c:1234 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: unmap_page_range+0x885/0x28a0 mm/memory.c:1255 #1: ffffffff899a5340 (rcu_read_lock){....}, at: lock_page_memcg+0x0/0x240 include/linux/cgroup.h:491 #2: ffffc90000007d50 ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline] #2: ffffc90000007d50 ((&sp->resync_t)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394 Preemption disabled at: [] spin_lock include/linux/spinlock.h:338 [inline] [] zap_pte_range mm/memory.c:1038 [inline] [] zap_pmd_range mm/memory.c:1184 [inline] [] zap_pud_range mm/memory.c:1213 [inline] [] zap_p4d_range mm/memory.c:1234 [inline] [] unmap_page_range+0x885/0x28a0 mm/memory.c:1255 CPU: 0 PID: 20484 Comm: blkid Not tainted 5.5.0-rc5-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+0x1fb/0x23e kernel/sched/core.c:6800 __might_sleep+0x95/0x190 kernel/sched/core.c:6753 __mutex_lock_common kernel/locking/mutex.c:935 [inline] __mutex_lock+0xc5/0x13c0 kernel/locking/mutex.c:1103 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1118 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:122 resync_tnc+0x1b6/0x320 drivers/net/hamradio/6pack.c:522 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:__kasan_check_write+0x15/0x20 mm/kasan/common.c:102 Code: 08 e8 1f 2a 00 00 5d c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 55 89 f6 ba 01 00 00 00 48 89 e5 48 8b 4d 08 e8 fc 29 00 00 5d 66 2e 0f 1f 84 00 00 00 00 00 55 31 d2 be 40 00 00 00 48 89 e5 RSP: 0018:ffffc90002d77940 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffffffff81a72505 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffea00002a15f0 RBP: ffffc90002d77988 R08: 1ffffd40000542be R09: fffff940000542bf R10: fffff940000542be R11: ffffea00002a15f3 R12: ffffea00002a15c0 R13: 0000000000000000 R14: ffffea00002a15c8 R15: ffffea00002a1588 zap_pte_range mm/memory.c:1080 [inline] zap_pmd_range mm/memory.c:1184 [inline] zap_pud_range mm/memory.c:1213 [inline] zap_p4d_range mm/memory.c:1234 [inline] unmap_page_range+0xde0/0x28a0 mm/memory.c:1255 unmap_single_vma+0x19d/0x300 mm/memory.c:1300 unmap_vmas+0x184/0x2f0 mm/memory.c:1332 exit_mmap+0x2ba/0x530 mm/mmap.c:3134 __mmput kernel/fork.c:1082 [inline] mmput+0x179/0x4d0 kernel/fork.c:1103 exit_mm kernel/exit.c:485 [inline] do_exit+0xac2/0x2f50 kernel/exit.c:788 do_group_exit+0x135/0x360 kernel/exit.c:899 __do_sys_exit_group kernel/exit.c:910 [inline] __se_sys_exit_group kernel/exit.c:908 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:908 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fc10aba31e8 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 19 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 f7 d8 64 41 89 01 RSP: 002b:00007ffe6891d628 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fc10aba31e8 RDX: 0000000000000002 RSI: 000000000000003c RDI: 0000000000000002 RBP: 00007fc10ae78840 R08: 00000000000000e7 R09: ffffffffffffffa8 R10: 00007fc10ae7e740 R11: 0000000000000246 R12: 00007fc10ae78840 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000 ================================ WARNING: inconsistent lock state 5.5.0-rc5-syzkaller #0 Tainted: G W -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. blkid/20484 [HC0[0]:SC1[1]:HE1:SE0] takes: ffffffff8c144750 (&tpk_port.port_write_mutex){+.?.}, at: tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:122 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1118 tpk_close+0x50/0x95 drivers/char/ttyprintk.c:103 tty_release+0x3ba/0xe90 drivers/tty/tty_io.c:1683 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x676/0x790 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe irq event stamp: 2882 hardirqs last enabled at (2882): [] trace_hardirqs_on_thunk+0x1a/0x1c arch/x86/entry/thunk_64.S:41 hardirqs last disabled at (2881): [] trace_hardirqs_off_thunk+0x1a/0x1c arch/x86/entry/thunk_64.S:42 softirqs last enabled at (966): [] copy_init_fpstate_to_fpregs arch/x86/kernel/fpu/core.c:308 [inline] softirqs last enabled at (966): [] fpu__clear+0x17c/0x440 arch/x86/kernel/fpu/core.c:332 softirqs last disabled at (2765): [] invoke_softirq kernel/softirq.c:373 [inline] softirqs last disabled at (2765): [] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 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 *** 3 locks held by blkid/20484: #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pte_range mm/memory.c:1038 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pmd_range mm/memory.c:1184 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pud_range mm/memory.c:1213 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_p4d_range mm/memory.c:1234 [inline] #0: ffff88808879c800 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: unmap_page_range+0x885/0x28a0 mm/memory.c:1255 #1: ffffffff899a5340 (rcu_read_lock){....}, at: lock_page_memcg+0x0/0x240 include/linux/cgroup.h:491 #2: ffffc90000007d50 ((&sp->resync_t)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:172 [inline] #2: ffffc90000007d50 ((&sp->resync_t)){+.-.}, at: call_timer_fn+0xe0/0x780 kernel/time/timer.c:1394 stack backtrace: CPU: 0 PID: 20484 Comm: blkid Tainted: G W 5.5.0-rc5-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+0x327/0x378 kernel/locking/lockdep.c:3101 valid_state kernel/locking/lockdep.c:3112 [inline] mark_lock_irq kernel/locking/lockdep.c:3309 [inline] mark_lock+0xbb4/0x1220 kernel/locking/lockdep.c:3666 mark_usage kernel/locking/lockdep.c:3566 [inline] __lock_acquire+0x1e8e/0x4a00 kernel/locking/lockdep.c:3909 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4485 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1118 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:122 resync_tnc+0x1b6/0x320 drivers/net/hamradio/6pack.c:522 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:__kasan_check_write+0x15/0x20 mm/kasan/common.c:102 Code: 08 e8 1f 2a 00 00 5d c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 55 89 f6 ba 01 00 00 00 48 89 e5 48 8b 4d 08 e8 fc 29 00 00 5d 66 2e 0f 1f 84 00 00 00 00 00 55 31 d2 be 40 00 00 00 48 89 e5 RSP: 0018:ffffc90002d77940 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffffffff81a72505 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffea00002a15f0 RBP: ffffc90002d77988 R08: 1ffffd40000542be R09: fffff940000542bf R10: fffff940000542be R11: ffffea00002a15f3 R12: ffffea00002a15c0 R13: 0000000000000000 R14: ffffea00002a15c8 R15: ffffea00002a1588 zap_pte_range mm/memory.c:1080 [inline] zap_pmd_range mm/memory.c:1184 [inline] zap_pud_range mm/memory.c:1213 [inline] zap_p4d_range mm/memory.c:1234 [inline] unmap_page_range+0xde0/0x28a0 mm/memory.c:1255 unmap_single_vma+0x19d/0x300 mm/memory.c:1300 unmap_vmas+0x184/0x2f0 mm/memory.c:1332 exit_mmap+0x2ba/0x530 mm/mmap.c:3134 __mmput kernel/fork.c:1082 [inline] mmput+0x179/0x4d0 kernel/fork.c:1103 exit_mm kernel/exit.c:485 [inline] do_exit+0xac2/0x2f50 kernel/exit.c:788 do_group_exit+0x135/0x360 kernel/exit.c:899 __do_sys_exit_group kernel/exit.c:910 [inline] __se_sys_exit_group kernel/exit.c:908 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:908 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fc10aba31e8 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 19 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 f7 d8 64 41 89 01 RSP: 002b:00007ffe6891d628 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fc10aba31e8 RDX: 0000000000000002 RSI: 000000000000003c RDI: 0000000000000002 RBP: 00007fc10ae78840 R08: 00000000000000e7 R09: ffffffffffffffa8 R10: 00007fc10ae7e740 R11: 0000000000000246 R12: 00007fc10ae78840 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000 BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 20484, name: blkid INFO: lockdep is turned off. Preemption disabled at: [] spin_lock include/linux/spinlock.h:338 [inline] [] zap_pte_range mm/memory.c:1038 [inline] [] zap_pmd_range mm/memory.c:1184 [inline] [] zap_pud_range mm/memory.c:1213 [inline] [] zap_p4d_range mm/memory.c:1234 [inline] [] unmap_page_range+0x885/0x28a0 mm/memory.c:1255 CPU: 0 PID: 20484 Comm: blkid Tainted: G W 5.5.0-rc5-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+0x1fb/0x23e kernel/sched/core.c:6800 __might_sleep+0x95/0x190 kernel/sched/core.c:6753 __mutex_lock_common kernel/locking/mutex.c:935 [inline] __mutex_lock+0xc5/0x13c0 kernel/locking/mutex.c:1103 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1118 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:122 resync_tnc+0x22e/0x320 drivers/net/hamradio/6pack.c:523 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:__kasan_check_write+0x15/0x20 mm/kasan/common.c:102 Code: 08 e8 1f 2a 00 00 5d c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 55 89 f6 ba 01 00 00 00 48 89 e5 48 8b 4d 08 e8 fc 29 00 00 5d 66 2e 0f 1f 84 00 00 00 00 00 55 31 d2 be 40 00 00 00 48 89 e5 RSP: 0018:ffffc90002d77940 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffffffff81a72505 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffea00002a15f0 RBP: ffffc90002d77988 R08: 1ffffd40000542be R09: fffff940000542bf R10: fffff940000542be R11: ffffea00002a15f3 R12: ffffea00002a15c0 R13: 0000000000000000 R14: ffffea00002a15c8 R15: ffffea00002a1588 zap_pte_range mm/memory.c:1080 [inline] zap_pmd_range mm/memory.c:1184 [inline] zap_pud_range mm/memory.c:1213 [inline] zap_p4d_range mm/memory.c:1234 [inline] unmap_page_range+0xde0/0x28a0 mm/memory.c:1255 unmap_single_vma+0x19d/0x300 mm/memory.c:1300 unmap_vmas+0x184/0x2f0 mm/memory.c:1332 exit_mmap+0x2ba/0x530 mm/mmap.c:3134 __mmput kernel/fork.c:1082 [inline] mmput+0x179/0x4d0 kernel/fork.c:1103 exit_mm kernel/exit.c:485 [inline] do_exit+0xac2/0x2f50 kernel/exit.c:788 do_group_exit+0x135/0x360 kernel/exit.c:899 __do_sys_exit_group kernel/exit.c:910 [inline] __se_sys_exit_group kernel/exit.c:908 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:908 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fc10aba31e8 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 19 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 f7 d8 64 41 89 01 RSP: 002b:00007ffe6891d628 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fc10aba31e8 RDX: 0000000000000002 RSI: 000000000000003c RDI: 0000000000000002 RBP: 00007fc10ae78840 R08: 00000000000000e7 R09: ffffffffffffffa8 R10: 00007fc10ae7e740 R11: 0000000000000246 R12: 00007fc10ae78840 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000 BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 9, name: ksoftirqd/0 INFO: lockdep is turned off. Preemption disabled at: [] __do_softirq+0xf3/0x98c kernel/softirq.c:269 CPU: 0 PID: 9 Comm: ksoftirqd/0 Tainted: G W 5.5.0-rc5-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+0x1fb/0x23e kernel/sched/core.c:6800 __might_sleep+0x95/0x190 kernel/sched/core.c:6753 __mutex_lock_common kernel/locking/mutex.c:935 [inline] __mutex_lock+0xc5/0x13c0 kernel/locking/mutex.c:1103 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1118 tpk_write+0x5d/0x340 drivers/char/ttyprintk.c:122 resync_tnc+0x1b6/0x320 drivers/net/hamradio/6pack.c:522 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 run_ksoftirqd kernel/softirq.c:603 [inline] run_ksoftirqd+0x8e/0x110 kernel/softirq.c:595 smpboot_thread_fn+0x6a3/0xa40 kernel/smpboot.c:165 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352