================================ WARNING: inconsistent lock state 6.10.0-rc6-syzkaller-00212-g1dd28064d416 #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.2.18/5313 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff88802c338a80 (lock#13){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff88802c338a80 (lock#13){?.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x7f/0x790 mm/mmap_lock.c:237 {HARDIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x97/0x790 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:164 [inline] walk_mm mm/vmscan.c:3648 [inline] try_to_inc_max_seq+0xa52/0x1250 mm/vmscan.c:3888 get_nr_to_scan mm/vmscan.c:4702 [inline] try_to_shrink_lruvec+0x736/0x9b0 mm/vmscan.c:4745 shrink_one+0x3f8/0x7c0 mm/vmscan.c:4788 shrink_many mm/vmscan.c:4851 [inline] lru_gen_shrink_node+0x89f/0x1750 mm/vmscan.c:4951 shrink_node mm/vmscan.c:5910 [inline] kswapd_shrink_node mm/vmscan.c:6720 [inline] balance_pgdat+0x1105/0x1970 mm/vmscan.c:6911 kswapd+0x5ea/0xbf0 mm/vmscan.c:7180 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 irq event stamp: 8928 hardirqs last enabled at (8927): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1418 [inline] hardirqs last enabled at (8927): [] finish_lock_switch kernel/sched/core.c:5162 [inline] hardirqs last enabled at (8927): [] finish_task_switch.isra.0+0x217/0xcc0 kernel/sched/core.c:5280 hardirqs last disabled at (8928): [] sysvec_call_function+0xe/0xb0 arch/x86/kernel/smp.c:257 softirqs last enabled at (8662): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (8662): [] handle_softirqs+0x5be/0x8f0 kernel/softirq.c:582 softirqs last disabled at (8647): [] __do_softirq kernel/softirq.c:588 [inline] softirqs last disabled at (8647): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (8647): [] __irq_exit_rcu kernel/softirq.c:637 [inline] softirqs last disabled at (8647): [] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#13); lock(lock#13); *** DEADLOCK *** 3 locks held by syz.2.18/5313: #0: ffffffff8e7da248 (reading_mutex){+.+.}-{3:3}, at: rng_dev_read+0x14a/0x730 drivers/char/hw_random/core.c:219 #1: ffffffff8dbb4ea0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #1: ffffffff8dbb4ea0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #1: ffffffff8dbb4ea0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #1: ffffffff8dbb4ea0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2444 #2: ffff888027499498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #2: ffff888027499498 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x28a/0x760 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 3 PID: 5313 Comm: syz.2.18 Not tainted 6.10.0-rc6-syzkaller-00212-g1dd28064d416 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_usage_bug kernel/locking/lockdep.c:3971 [inline] valid_state kernel/locking/lockdep.c:4013 [inline] mark_lock_irq kernel/locking/lockdep.c:4216 [inline] mark_lock+0x923/0xc60 kernel/locking/lockdep.c:4678 mark_usage kernel/locking/lockdep.c:4564 [inline] __lock_acquire+0x1359/0x3b30 kernel/locking/lockdep.c:5091 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x97/0x790 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:164 [inline] stack_map_get_build_id_offset+0x602/0x760 kernel/bpf/stackmap.c:141 __bpf_get_stack+0x68a/0x710 kernel/bpf/stackmap.c:449 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1994 [inline] bpf_get_stack_raw_tp+0x124/0x160 kernel/trace/bpf_trace.c:1984 bpf_prog_ec3b2eefa702d8d3+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run include/linux/filter.h:698 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline] bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2444 trace_tlb_flush+0xf3/0x170 include/trace/events/tlb.h:38 csd_do_func kernel/smp.c:133 [inline] __flush_smp_call_function_queue+0x27a/0x8c0 kernel/smp.c:511 __sysvec_call_function+0x8c/0x410 arch/x86/kernel/smp.c:262 instr_sysvec_call_function arch/x86/kernel/smp.c:257 [inline] sysvec_call_function+0x90/0xb0 arch/x86/kernel/smp.c:257 asm_sysvec_call_function+0x1a/0x20 arch/x86/include/asm/idtentry.h:710 RIP: 0010:finish_task_switch.isra.0+0x220/0xcc0 kernel/sched/core.c:5282 Code: a9 0a 00 00 44 8b 0d 87 90 83 0e 45 85 c9 0f 85 c0 01 00 00 48 89 df e8 ae f8 ff ff e8 09 9a 36 00 fb 65 48 8b 1d 50 a1 a4 7e <48> 8d bb f8 15 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 RSP: 0018:ffffc90002eaf640 EFLAGS: 00000202 RAX: 00000000000022df RBX: ffff88801ea4a440 RCX: 1ffffffff2842c89 RDX: 0000000000000000 RSI: ffffffff8b2cb9e0 RDI: ffffffff8b8fb620 RBP: ffffc90002eaf688 R08: 0000000000000001 R09: fffffbfff283e663 R10: ffffffff941f331f R11: 0000000000000001 R12: ffff88802c33f938 R13: ffff88801b594880 R14: 0000000000000000 R15: ffff88802c23ebc0 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_timeout+0x258/0x2a0 kernel/time/timer.c:2557 do_wait_for_common kernel/sched/completion.c:95 [inline] __wait_for_common+0x3de/0x5f0 kernel/sched/completion.c:116 wait_for_common kernel/sched/completion.c:127 [inline] wait_for_completion_killable+0x1f/0x40 kernel/sched/completion.c:254 virtio_read+0x1d1/0x6b0 drivers/char/hw_random/virtio-rng.c:105 rng_get_data drivers/char/hw_random/core.c:186 [inline] rng_dev_read+0x465/0x730 drivers/char/hw_random/core.c:224 do_loop_readv_writev fs/read_write.c:761 [inline] do_loop_readv_writev fs/read_write.c:749 [inline] vfs_readv+0x6cb/0x8a0 fs/read_write.c:934 do_preadv+0x1b2/0x260 fs/read_write.c:1049 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7473579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5d8b57c EFLAGS: 00000292 ORIG_RAX: 000000000000014d RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000020000240 RDX: 0000000000000001 RSI: 00000000fffffffd RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: a9 0a 00 00 44 test $0x4400000a,%eax 5: 8b 0d 87 90 83 0e mov 0xe839087(%rip),%ecx # 0xe839092 b: 45 85 c9 test %r9d,%r9d e: 0f 85 c0 01 00 00 jne 0x1d4 14: 48 89 df mov %rbx,%rdi 17: e8 ae f8 ff ff call 0xfffff8ca 1c: e8 09 9a 36 00 call 0x369a2a 21: fb sti 22: 65 48 8b 1d 50 a1 a4 mov %gs:0x7ea4a150(%rip),%rbx # 0x7ea4a17a 29: 7e * 2a: 48 8d bb f8 15 00 00 lea 0x15f8(%rbx),%rdi <-- trapping instruction 31: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 38: fc ff df 3b: 48 89 fa mov %rdi,%rdx 3e: 48 rex.W 3f: c1 .byte 0xc1