================================ WARNING: inconsistent lock state 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.2/6673 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff88817fffc728 (&pgdat->memcg_lru.lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] ffff88817fffc728 (&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: 3889 hardirqs last enabled at (3888): [] mod_memcg_state include/linux/memcontrol.h:982 [inline] hardirqs last enabled at (3888): [] memcg_account_kmem+0x4f/0x80 mm/memcontrol.c:3094 hardirqs last disabled at (3889): [] uncharge_batch+0x1c7/0x560 mm/memcontrol.c:7142 softirqs last enabled at (830): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (830): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 softirqs last disabled at (3793): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (3793): [] __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.2/6673: #0: ffff88814c07a0e0 (&type->s_umount_key#70/1){+.+.}-{3:3}, at: alloc_super+0x22e/0xb60 fs/super.c:228 #1: ffffffff8c783f60 (console_lock){+.+.}-{0:0}, at: vprintk+0x84/0xa0 kernel/printk/printk_safe.c:50 #2: ffffffff8c783fd0 (console_srcu){....}-{0:0}, at: console_emit_next_record kernel/printk/printk.c:2842 [inline] #2: ffffffff8c783fd0 (console_srcu){....}-{0:0}, at: console_flush_all+0xe2/0xcc0 kernel/printk/printk.c:2933 #3: ffffffff8c795fe0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2104 [inline] #3: ffffffff8c795fe0 (rcu_callback){....}-{0:0}, at: rcu_core+0x791/0x1ad0 kernel/rcu/tree.c:2377 stack backtrace: CPU: 2 PID: 6673 Comm: syz-executor.2 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #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:__sanitizer_cov_trace_pc+0x0/0x70 kernel/kcov.c:200 Code: 56 d7 8e 02 66 0f 1f 44 00 00 f3 0f 1e fa 48 8b be a8 01 00 00 e8 b0 ff ff ff 31 c0 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 1e fa 65 8b 05 4d 54 80 7e 89 c1 48 8b 34 24 81 e1 00 01 00 RSP: 0018:ffffc9000bd4f4c0 EFLAGS: 00000206 RAX: 000000000001b540 RBX: 0000000000000200 RCX: ffffc9000c181000 RDX: 0000000000040000 RSI: ffffffff81677f95 RDI: 0000000000000007 RBP: ffffffff8d25b138 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000200 R11: 282073662d544146 R12: 0000000000000000 R13: ffffffff8d25b0e0 R14: dffffc0000000000 R15: 0000000000000001 console_emit_next_record arch/x86/include/asm/irqflags.h:42 [inline] console_flush_all+0x61b/0xcc0 kernel/printk/printk.c:2933 console_unlock+0xb8/0x1f0 kernel/printk/printk.c:3007 vprintk_emit+0x1bd/0x600 kernel/printk/printk.c:2307 vprintk+0x84/0xa0 kernel/printk/printk_safe.c:50 _printk+0xbf/0xf0 kernel/printk/printk.c:2328 _fat_msg+0xe1/0x120 fs/fat/misc.c:62 fat__get_entry+0x5dd/0x920 fs/fat/dir.c:102 fat_get_entry fs/fat/dir.c:128 [inline] fat_get_short_entry+0x13f/0x2f0 fs/fat/dir.c:873 fat_subdirs+0xa9/0x180 fs/fat/dir.c:939 fat_read_root fs/fat/inode.c:1412 [inline] fat_fill_super+0x255b/0x3a00 fs/fat/inode.c:1859 mount_bdev+0x358/0x420 fs/super.c:1380 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7effe808d67a Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007effe8e49f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 000000000000032c RCX: 00007effe808d67a RDX: 00000000200001c0 RSI: 0000000020000200 RDI: 00007effe8e49fe0 RBP: 00007effe8e4a020 R08: 00007effe8e4a020 R09: 0000000001000004 R10: 0000000001000004 R11: 0000000000000202 R12: 00000000200001c0 R13: 0000000020000200 R14: 00007effe8e49fe0 R15: 0000000020000000 ---------------- Code disassembly (best guess): 0: 56 push %rsi 1: d7 xlat %ds:(%rbx) 2: 8e 02 mov (%rdx),%es 4: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) a: f3 0f 1e fa endbr64 e: 48 8b be a8 01 00 00 mov 0x1a8(%rsi),%rdi 15: e8 b0 ff ff ff callq 0xffffffca 1a: 31 c0 xor %eax,%eax 1c: c3 retq 1d: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 24: 00 00 00 00 28: 66 90 xchg %ax,%ax * 2a: f3 0f 1e fa endbr64 <-- trapping instruction 2e: 65 8b 05 4d 54 80 7e mov %gs:0x7e80544d(%rip),%eax # 0x7e805482 35: 89 c1 mov %eax,%ecx 37: 48 8b 34 24 mov (%rsp),%rsi 3b: 81 .byte 0x81 3c: e1 00 loope 0x3e 3e: 01 00 add %eax,(%rax)