================================ WARNING: inconsistent lock state 6.4.0-rc7-syzkaller-00041-ge660abd551f1 #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.0/27614 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff88807ffdc728 (&pgdat->memcg_lru.lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] ffff88807ffdc728 (&pgdat->memcg_lru.lock){+.?.}-{2:2}, at: lru_gen_rotate_memcg+0x64/0xab0 mm/vmscan.c:4749 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] lru_gen_online_memcg+0x16b/0x5a0 mm/vmscan.c:4797 mem_cgroup_css_online+0x227/0x3b0 mm/memcontrol.c:5468 online_css+0xaf/0x2a0 kernel/cgroup/cgroup.c:5491 cgroup_init_subsys+0x46b/0x900 kernel/cgroup/cgroup.c:6022 cgroup_init+0xb83/0x1090 kernel/cgroup/cgroup.c:6106 start_kernel+0x398/0x490 init/main.c:1077 x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:556 x86_64_start_kernel+0xb3/0xc0 arch/x86/kernel/head64.c:537 secondary_startup_64_no_verify+0xf4/0xfb irq event stamp: 131753 hardirqs last enabled at (131752): [] mod_memcg_state include/linux/memcontrol.h:982 [inline] hardirqs last enabled at (131752): [] memcg_account_kmem+0x4f/0x80 mm/memcontrol.c:3094 hardirqs last disabled at (131753): [] uncharge_batch+0x1c7/0x560 mm/memcontrol.c:7142 softirqs last enabled at (127588): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (127588): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 softirqs last disabled at (131681): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (131681): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&pgdat->memcg_lru.lock); lock(&pgdat->memcg_lru.lock); *** DEADLOCK *** 4 locks held by syz-executor.0/27614: #0: ffff88810b522460 (sb_writers#5){.+.+}-{0:0}, at: get_signal+0x1c02/0x25b0 kernel/signal.c:2862 #1: ffff88802fb5c680 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline] #1: ffff88802fb5c680 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: ext4_buffered_write_iter+0xb0/0x460 fs/ext4/file.c:283 #2: ffffffff8c796140 (rcu_read_lock){....}-{1:2}, at: folio_memcg_lock+0x4/0x640 mm/memcontrol.c:2132 #3: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2104 [inline] #3: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_core+0x791/0x1ad0 kernel/rcu/tree.c:2377 stack backtrace: CPU: 0 PID: 27614 Comm: syz-executor.0 Not tainted 6.4.0-rc7-syzkaller-00041-ge660abd551f1 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:3949 [inline] valid_state kernel/locking/lockdep.c:3991 [inline] mark_lock_irq kernel/locking/lockdep.c:4194 [inline] mark_lock.part.0+0x1110/0x1970 kernel/locking/lockdep.c:4656 mark_lock kernel/locking/lockdep.c:4620 [inline] mark_usage kernel/locking/lockdep.c:4545 [inline] __lock_acquire+0x1227/0x5f30 kernel/locking/lockdep.c:5042 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] lru_gen_rotate_memcg+0x64/0xab0 mm/vmscan.c:4749 lru_gen_soft_reclaim+0x62/0x70 mm/vmscan.c:4852 uncharge_batch+0x2be/0x560 mm/memcontrol.c:7145 __mem_cgroup_uncharge+0x11f/0x290 mm/memcontrol.c:7221 mem_cgroup_uncharge include/linux/memcontrol.h:698 [inline] __folio_put_small mm/swap.c:105 [inline] __folio_put+0xb6/0x140 mm/swap.c:129 folio_put include/linux/mm.h:1430 [inline] put_page include/linux/mm.h:1499 [inline] free_page_and_swap_cache+0x257/0x2c0 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:34 [inline] __tlb_remove_table_free mm/mmu_gather.c:153 [inline] tlb_remove_table_rcu+0x89/0xe0 mm/mmu_gather.c:208 rcu_do_batch kernel/rcu/tree.c:2115 [inline] rcu_core+0x806/0x1ad0 kernel/rcu/tree.c:2377 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x3c/0x70 kernel/locking/spinlock.c:194 Code: 74 24 10 e8 46 eb 51 f7 48 89 ef e8 6e 59 52 f7 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 df 2e 44 f7 65 8b 05 20 9e f0 75 85 c0 74 0a 5b 5d c3 e8 6c e5 RSP: 0018:ffffc90028447050 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff22abcae RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff88802fb5c760 R08: 0000000000000001 R09: ffffffff9151fda7 R10: 0000000000000001 R11: 0000000000094001 R12: 0000000000000000 R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000 mark_buffer_dirty+0x31e/0x3e0 fs/buffer.c:1154 __block_commit_write.constprop.0.isra.0+0x19d/0x330 fs/buffer.c:2138 block_write_end+0x53/0x220 fs/buffer.c:2217 generic_write_end+0x8d/0x440 fs/buffer.c:2231 ext4_da_write_end+0x19b/0xad0 fs/ext4/inode.c:3012 generic_perform_write+0x316/0x570 mm/filemap.c:3940 ext4_buffered_write_iter+0x15b/0x460 fs/ext4/file.c:289 ext4_file_write_iter+0xbe0/0x1740 fs/ext4/file.c:710 __kernel_write_iter+0x262/0x7a0 fs/read_write.c:517 dump_emit_page fs/coredump.c:888 [inline] dump_user_range+0x23c/0x710 fs/coredump.c:915 elf_core_dump+0x277e/0x36e0 fs/binfmt_elf.c:2142 do_coredump+0x2f2b/0x4020 fs/coredump.c:764 get_signal+0x1c02/0x25b0 kernel/signal.c:2862 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 irqentry_exit_to_user_mode+0x9/0x40 kernel/entry/common.c:310 asm_exc_general_protection+0x26/0x30 arch/x86/include/asm/idtentry.h:564 RIP: 0033:0x7f38e768c391 Code: c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 48 3d 01 f0 ff ff 73 01 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:00000000200000e0 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f38e77ac050 RCX: 00007f38e768c389 RDX: 0000000020000100 RSI: 00000000200000e0 RDI: 0000000008108000 RBP: 00007f38e76d7493 R08: 0000000020000180 R09: 0000000020000180 R10: 0000000020000140 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffdbea827ff R14: 00007f38e8480300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 74 24 je 0x26 2: 10 e8 adc %ch,%al 4: 46 eb 51 rex.RX jmp 0x58 7: f7 48 89 ef e8 6e 59 testl $0x596ee8ef,-0x77(%rax) e: 52 push %rdx f: f7 81 e3 00 02 00 00 testl $0x9c257500,0x200e3(%rcx) 16: 75 25 9c 19: 58 pop %rax 1a: f6 c4 02 test $0x2,%ah 1d: 75 2d jne 0x4c 1f: 48 85 db test %rbx,%rbx 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 df 2e 44 f7 callq 0xf7442f0e <-- trapping instruction 2f: 65 8b 05 20 9e f0 75 mov %gs:0x75f09e20(%rip),%eax # 0x75f09e56 36: 85 c0 test %eax,%eax 38: 74 0a je 0x44 3a: 5b pop %rbx 3b: 5d pop %rbp 3c: c3 retq 3d: e8 .byte 0xe8 3e: 6c insb (%dx),%es:(%rdi) 3f: e5 .byte 0xe5