================================ WARNING: inconsistent lock state 6.4.0-rc7-syzkaller-00067-g2214170caabb #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.1/4944 [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:4734 {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:4782 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: 29595 hardirqs last enabled at (29594): [] mod_memcg_state include/linux/memcontrol.h:982 [inline] hardirqs last enabled at (29594): [] memcg_account_kmem+0x4f/0x80 mm/memcontrol.c:3094 hardirqs last disabled at (29595): [] uncharge_batch+0x1c7/0x560 mm/memcontrol.c:7142 softirqs last enabled at (23308): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (23308): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 softirqs last disabled at (29421): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (29421): [] __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 *** 3 locks held by syz-executor.1/4944: #0: ffff888022494460 (sb_writers#5){.+.+}-{0:0}, at: get_signal+0x1c02/0x25b0 kernel/signal.c:2862 #1: ffff8880560628c0 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline] #1: ffff8880560628c0 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: ext4_buffered_write_iter+0xb0/0x460 fs/ext4/file.c:283 #2: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2104 [inline] #2: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_core+0x791/0x1ad0 kernel/rcu/tree.c:2377 stack backtrace: CPU: 2 PID: 4944 Comm: syz-executor.1 Not tainted 6.4.0-rc7-syzkaller-00067-g2214170caabb #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:4734 lru_gen_soft_reclaim+0x62/0x70 mm/vmscan.c:4837 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:preempt_count_add+0x36/0x140 kernel/sched/core.c:5815 Code: 48 ba 00 00 00 00 00 fc ff df 48 89 c1 53 83 e0 07 89 fb 48 c1 e9 03 83 c0 03 0f b6 14 11 38 d0 7c 08 84 d2 0f 85 e1 00 00 00 <8b> 15 a4 6e 87 10 65 01 1d a5 44 ac 7e 85 d2 75 11 65 8b 05 9a 44 RSP: 0000:ffffc9000c926ab8 EFLAGS: 00000297 RAX: 0000000000000003 RBX: 0000000000000001 RCX: 1ffffffff23bdc80 RDX: 0000000000000004 RSI: ffffffff81718aa0 RDI: 0000000000000001 RBP: ffffc9000c926b88 R08: 0000000000000001 R09: ffffc9000c926bd0 R10: ffffc9000c926b40 R11: 0000000000094001 R12: ffffc9000c926bf8 R13: ffffc9000c926b40 R14: ffff88804cc6c0c0 R15: 00000000000000a8 unwind_next_frame+0xad/0x1e30 arch/x86/kernel/unwind_orc.c:451 arch_stack_walk+0x81/0xf0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x90/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slab.c:3256 [inline] slab_alloc mm/slab.c:3265 [inline] __kmem_cache_alloc_lru mm/slab.c:3442 [inline] kmem_cache_alloc+0x1bd/0x3f0 mm/slab.c:3451 kmem_cache_zalloc include/linux/slab.h:670 [inline] alloc_buffer_head+0x24/0x150 fs/buffer.c:2974 folio_alloc_buffers+0x2f2/0x810 fs/buffer.c:871 folio_create_empty_buffers+0x2c/0x470 fs/buffer.c:1606 ext4_block_write_begin+0xb9c/0xde0 fs/ext4/inode.c:1040 ext4_da_write_begin+0x407/0x8c0 fs/ext4/inode.c:2918 generic_perform_write+0x256/0x570 mm/filemap.c:3929 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 exc_page_fault+0xc0/0x170 arch/x86/mm/fault.c:1593 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0xdca5 Code: Unable to access opcode bytes at 0xdc7b. RSP: 002b:00000000200000a8 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007fa8c37abf80 RCX: 00007fa8c368c389 RDX: 00000000200000c0 RSI: 00000000200000a0 RDI: 0000000004000000 RBP: 00007fa8c36d7493 R08: 0000000020000300 R09: 0000000020000300 R10: 0000000020000100 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffc5b93b16f R14: 00007fa8c436f300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 7: fc ff df a: 48 89 c1 mov %rax,%rcx d: 53 push %rbx e: 83 e0 07 and $0x7,%eax 11: 89 fb mov %edi,%ebx 13: 48 c1 e9 03 shr $0x3,%rcx 17: 83 c0 03 add $0x3,%eax 1a: 0f b6 14 11 movzbl (%rcx,%rdx,1),%edx 1e: 38 d0 cmp %dl,%al 20: 7c 08 jl 0x2a 22: 84 d2 test %dl,%dl 24: 0f 85 e1 00 00 00 jne 0x10b * 2a: 8b 15 a4 6e 87 10 mov 0x10876ea4(%rip),%edx # 0x10876ed4 <-- trapping instruction 30: 65 01 1d a5 44 ac 7e add %ebx,%gs:0x7eac44a5(%rip) # 0x7eac44dc 37: 85 d2 test %edx,%edx 39: 75 11 jne 0x4c 3b: 65 gs 3c: 8b .byte 0x8b 3d: 05 .byte 0x5 3e: 9a (bad) 3f: 44 rex.R