================================ WARNING: inconsistent lock state 6.10.0-syzkaller-05505-gb1bc554e009e #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.1.187/5715 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff88802c138aa0 (lock#13){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff88802c138aa0 (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:5753 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5718 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+0x2b5/0x13f0 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_iter lib/iov_iter.c:25 [inline] iterate_iovec include/linux/iov_iter.h:51 [inline] iterate_and_advance2 include/linux/iov_iter.h:247 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] _copy_to_iter+0x48f/0xfc0 lib/iov_iter.c:185 copy_page_to_iter lib/iov_iter.c:362 [inline] copy_page_to_iter+0xf1/0x180 lib/iov_iter.c:349 process_vm_rw_pages mm/process_vm_access.c:45 [inline] process_vm_rw_single_vec mm/process_vm_access.c:118 [inline] process_vm_rw_core.constprop.0+0x5c9/0xa10 mm/process_vm_access.c:216 process_vm_rw+0x301/0x360 mm/process_vm_access.c:284 __do_sys_process_vm_readv mm/process_vm_access.c:296 [inline] __se_sys_process_vm_readv mm/process_vm_access.c:292 [inline] __ia32_sys_process_vm_readv+0xdf/0x1b0 mm/process_vm_access.c:292 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: 1268 hardirqs last enabled at (1267): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (1267): [] _raw_spin_unlock_irqrestore+0x52/0x80 kernel/locking/spinlock.c:194 hardirqs last disabled at (1268): [] sysvec_call_function_single+0xe/0xb0 arch/x86/kernel/smp.c:266 softirqs last enabled at (0): [] copy_process+0x1ee0/0x6f50 kernel/fork.c:2319 softirqs last disabled at (0): [<0000000000000000>] 0x0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#13); lock(lock#13); *** DEADLOCK *** 7 locks held by syz.1.187/5715: #0: ffff88801ddf8420 (sb_writers#4){.+.+}-{0:0}, at: ioctl_preallocate+0x1a8/0x220 fs/ioctl.c:291 #1: ffff88802a41d3b8 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:799 [inline] #1: ffff88802a41d3b8 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_fallocate+0x342/0x3f60 fs/ext4/extents.c:4766 #2: ffff88801d7f4950 (jbd2_handle){.+.+}-{0:0}, at: start_this_handle+0x10db/0x15e0 fs/jbd2/transaction.c:463 #3: ffff88802a41d248 (&ei->i_data_sem){++++}-{3:3}, at: ext4_map_blocks+0x5ab/0x17d0 fs/ext4/inode.c:616 #4: ffff88802c137fa0 (lock#4){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] #4: ffff88802c137fa0 (lock#4){+.+.}-{2:2}, at: folio_add_lru+0x298/0x7f0 mm/swap.c:520 #5: ffffffff8dbb4e60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:327 [inline] #5: ffffffff8dbb4e60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:839 [inline] #5: ffffffff8dbb4e60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2405 [inline] #5: ffffffff8dbb4e60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2447 #6: ffff888025c54418 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #6: ffff888025c54418 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x28a/0x760 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 1 PID: 5715 Comm: syz.1.187 Not tainted 6.10.0-syzkaller-05505-gb1bc554e009e #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:3970 [inline] valid_state kernel/locking/lockdep.c:4012 [inline] mark_lock_irq kernel/locking/lockdep.c:4215 [inline] mark_lock+0x923/0xc60 kernel/locking/lockdep.c:4677 mark_usage kernel/locking/lockdep.c:4563 [inline] __lock_acquire+0x1359/0x3b30 kernel/locking/lockdep.c:5090 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5718 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:1997 [inline] bpf_get_stack_raw_tp+0x124/0x160 kernel/trace/bpf_trace.c:1987 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:2406 [inline] bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2447 __traceiter_tlb_flush+0x64/0xb0 include/trace/events/tlb.h:38 trace_tlb_flush+0xf3/0x170 include/trace/events/tlb.h:38 csd_do_func kernel/smp.c:134 [inline] __flush_smp_call_function_queue+0x27a/0x8c0 kernel/smp.c:512 __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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:194 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 46 78 87 f6 48 89 df e8 0e f5 87 f6 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 d5 73 79 f6 65 8b 05 d6 a8 1e 75 85 c0 74 16 5b RSP: 0018:ffffc90006d3ee40 EFLAGS: 00000246 RAX: 0000000000000006 RBX: ffff8880545b4050 RCX: 1ffffffff2849a92 RDX: 0000000000000000 RSI: ffffffff8b2cc020 RDI: ffffffff8b902d40 RBP: 0000000000000246 R08: 0000000000000001 R09: fffffbfff284506b R10: ffffffff9422835f R11: 0000000000000006 R12: 000000000000001d R13: dffffc0000000000 R14: ffff88802c137fd0 R15: ffff88802c1380c0 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] unlock_page_lruvec_irqrestore include/linux/memcontrol.h:1636 [inline] folio_lruvec_relock_irqsave include/linux/memcontrol.h:1669 [inline] folio_batch_move_lru+0x21d/0x400 mm/swap.c:219 folio_batch_add_and_move+0xe5/0x160 mm/swap.c:236 folio_add_lru+0x37d/0x7f0 mm/swap.c:522 filemap_add_folio+0x1bd/0x220 mm/filemap.c:986 __filemap_get_folio+0x474/0xae0 mm/filemap.c:1958 ext4_mb_load_buddy_gfp+0x3c0/0xe90 fs/ext4/mballoc.c:1640 ext4_mb_load_buddy fs/ext4/mballoc.c:1733 [inline] ext4_mb_find_by_goal+0x23b/0xd90 fs/ext4/mballoc.c:2346 ext4_mb_regular_allocator+0x23f/0x3f60 fs/ext4/mballoc.c:2818 ext4_mb_new_blocks+0x2830/0x4e40 fs/ext4/mballoc.c:6219 ext4_ext_map_blocks+0x1c24/0x5cd0 fs/ext4/extents.c:4318 ext4_map_blocks+0x61d/0x17d0 fs/ext4/inode.c:623 ext4_alloc_file_blocks.isra.0+0x2dc/0xba0 fs/ext4/extents.c:4495 ext4_fallocate+0x4dc/0x3f60 fs/ext4/extents.c:4792 vfs_fallocate+0x4ca/0xfc0 fs/open.c:334 ioctl_preallocate+0x1a8/0x220 fs/ioctl.c:291 file_ioctl fs/ioctl.c:331 [inline] do_vfs_ioctl+0x16a0/0x1a90 fs/ioctl.c:886 __do_compat_sys_ioctl+0x149/0x330 fs/ioctl.c:1001 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:0xf7f93579 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:00000000f5d2557c EFLAGS: 00000292 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000000000a RCX: 000000004030582a RDX: 0000000020000240 RSI: 0000000000000000 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: f5 cmc 1: 53 push %rbx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 89 fb mov %rdi,%rbx a: 48 83 c7 18 add $0x18,%rdi e: e8 46 78 87 f6 call 0xf6877859 13: 48 89 df mov %rbx,%rdi 16: e8 0e f5 87 f6 call 0xf687f529 1b: f7 c5 00 02 00 00 test $0x200,%ebp 21: 75 23 jne 0x46 23: 9c pushf 24: 58 pop %rax 25: f6 c4 02 test $0x2,%ah 28: 75 37 jne 0x61 * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 d5 73 79 f6 call 0xf6797409 34: 65 8b 05 d6 a8 1e 75 mov %gs:0x751ea8d6(%rip),%eax # 0x751ea911 3b: 85 c0 test %eax,%eax 3d: 74 16 je 0x55 3f: 5b pop %rbx