================================ WARNING: inconsistent lock state 6.10.0-rc7-syzkaller-00266-g4d145e3f830b #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.0.247/6015 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff88802c038a80 (lock#13){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff88802c038a80 (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] get_mmap_lock_carefully mm/memory.c:5716 [inline] lock_mm_and_find_vma+0xeb/0x6a0 mm/memory.c:5776 do_user_addr_fault+0x29c/0xe50 arch/x86/mm/fault.c:1361 handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:131 [inline] _copy_to_user lib/usercopy.c:46 [inline] _copy_to_user+0xa7/0xc0 lib/usercopy.c:39 copy_to_user include/linux/uaccess.h:191 [inline] rng_dev_read+0x24b/0x730 drivers/char/hw_random/core.c:252 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 irq event stamp: 149170 hardirqs last enabled at (149169): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1418 [inline] hardirqs last enabled at (149169): [] finish_lock_switch kernel/sched/core.c:5162 [inline] hardirqs last enabled at (149169): [] finish_task_switch.isra.0+0x217/0xcc0 kernel/sched/core.c:5280 hardirqs last disabled at (149170): [] sysvec_call_function_single+0xe/0xb0 arch/x86/kernel/smp.c:266 softirqs last enabled at (148804): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (148804): [] handle_softirqs+0x5be/0x8f0 kernel/softirq.c:582 softirqs last disabled at (148797): [] __do_softirq kernel/softirq.c:588 [inline] softirqs last disabled at (148797): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (148797): [] __irq_exit_rcu kernel/softirq.c:637 [inline] softirqs last disabled at (148797): [] 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.0.247/6015: #0: ffff88802be82580 (&u->iolock){+.+.}-{3:3}, at: __unix_dgram_recvmsg+0x267/0xf50 net/unix/af_unix.c:2385 #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: ffff8880265fa798 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #2: ffff8880265fa798 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x28a/0x760 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 0 PID: 6015 Comm: syz.0.247 Not tainted 6.10.0-rc7-syzkaller-00266-g4d145e3f830b #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_single+0x8c/0x410 arch/x86/kernel/smp.c:271 instr_sysvec_call_function_single arch/x86/kernel/smp.c:266 [inline] sysvec_call_function_single+0x90/0xb0 arch/x86/kernel/smp.c:266 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709 RIP: 0010:finish_task_switch.isra.0+0x220/0xcc0 kernel/sched/core.c:5282 Code: a9 0a 00 00 44 8b 0d c7 de 83 0e 45 85 c9 0f 85 c0 01 00 00 48 89 df e8 ae f8 ff ff e8 59 9a 36 00 fb 65 48 8b 1d 10 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:ffffc90006e47550 EFLAGS: 00000206 RAX: 00000000000246b1 RBX: ffff8880206fa440 RCX: 1ffffffff28481ba RDX: 0000000000000000 RSI: ffffffff8b2cb9e0 RDI: ffffffff8b8ff8e0 RBP: ffffc90006e47598 R08: 0000000000000001 R09: fffffbfff283f46e R10: ffffffff941fa377 R11: 0000000000000001 R12: ffff88802c03f938 R13: ffff888020ed8000 R14: 0000000000000000 R15: ffff88802c03ebc0 context_switch kernel/sched/core.c:5411 [inline] __schedule+0xf1d/0x5d00 kernel/sched/core.c:6745 preempt_schedule_common+0x44/0xc0 kernel/sched/core.c:6924 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0x61/0x80 kernel/locking/spinlock.c:194 __unix_dgram_recvmsg+0x32a/0xf50 net/unix/af_unix.c:2415 unix_dgram_recvmsg+0xd0/0x110 net/unix/af_unix.c:2490 sock_recvmsg_nosec net/socket.c:1046 [inline] ____sys_recvmsg+0x5fe/0x6b0 net/socket.c:2802 ___sys_recvmsg+0x115/0x1a0 net/socket.c:2846 do_recvmmsg+0x51a/0x750 net/socket.c:2932 __sys_recvmmsg+0x21e/0x280 net/socket.c:3019 __do_compat_sys_recvmmsg_time32 net/compat.c:418 [inline] __se_compat_sys_recvmmsg_time32 net/compat.c:414 [inline] __ia32_compat_sys_recvmmsg_time32+0xc4/0x160 net/compat.c:414 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:0xf73ad579 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:00000000f5ca457c EFLAGS: 00000292 ORIG_RAX: 0000000000000151 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00000000200000c0 RDX: 0000000000010106 RSI: 0000000000000002 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 c7 de 83 0e mov 0xe83dec7(%rip),%ecx # 0xe83ded2 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 59 9a 36 00 call 0x369a7a 21: fb sti 22: 65 48 8b 1d 10 a1 a4 mov %gs:0x7ea4a110(%rip),%rbx # 0x7ea4a13a 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