================================ WARNING: inconsistent lock state 6.4.0-rc7-syzkaller-00072-gdad9774deaf1 #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. udevd/4623 [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: 15086795 hardirqs last enabled at (15086794): [] mod_memcg_state include/linux/memcontrol.h:982 [inline] hardirqs last enabled at (15086794): [] memcg_account_kmem+0x4f/0x80 mm/memcontrol.c:3094 hardirqs last disabled at (15086795): [] uncharge_batch+0x1c7/0x560 mm/memcontrol.c:7142 softirqs last enabled at (15081988): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (15081988): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 softirqs last disabled at (15086653): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (15086653): [] __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 *** 2 locks held by udevd/4623: #0: ffffffff8cfeffd0 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_path_perm+0x1c5/0x430 security/tomoyo/file.c:847 #1: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2104 [inline] #1: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_core+0x791/0x1ad0 kernel/rcu/tree.c:2377 stack backtrace: CPU: 0 PID: 4623 Comm: udevd Not tainted 6.4.0-rc7-syzkaller-00072-gdad9774deaf1 #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:__kmem_cache_free+0xfd/0x2c0 mm/slab.c:3584 Code: f2 4c 89 ee 4c 89 e7 e8 11 eb ff ff 48 85 db 0f 85 95 00 00 00 9c 58 f6 c4 02 0f 85 b9 00 00 00 48 85 db 74 01 fb 48 83 c4 20 <5b> 5d 41 5c 41 5d 41 5e 41 5f c3 f7 c5 ff 0f 00 00 0f 85 60 ff ff RSP: 0018:ffffc9000365fa48 EFLAGS: 00000286 RAX: 0000000000000002 RBX: 0000000000000200 RCX: 1ffffffff22a6f6e RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffea00007ea980 R08: 0000000000000001 R09: ffffffff9151fd3f R10: 0000000000000001 R11: 0000000000094001 R12: ffff888012440200 R13: ffff88801faa6600 R14: ffffffff83d76fd6 R15: 0000000000000001 tomoyo_path_perm+0x256/0x430 security/tomoyo/file.c:842 security_inode_getattr+0xd3/0x140 security/security.c:2114 vfs_getattr fs/stat.c:167 [inline] vfs_statx+0x16e/0x430 fs/stat.c:242 vfs_fstatat+0x90/0xb0 fs/stat.c:276 __do_sys_newfstatat+0x8a/0x110 fs/stat.c:446 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:0x7f1a847165f4 Code: 64 c7 00 09 00 00 00 83 c8 ff c3 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 00 00 00 00 41 89 ca b8 06 01 00 00 0f 05 <45> 31 c0 3d 00 f0 ff ff 76 10 48 8b 15 03 a8 0d 00 f7 d8 41 83 c8 RSP: 002b:00007fff3a688aa8 EFLAGS: 00000202 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 000055a1044e4750 RCX: 00007f1a847165f4 RDX: 00007fff3a688ac0 RSI: 00007f1a847b3130 RDI: 000000000000000d RBP: 000055a104506390 R08: 0000000000090800 R09: 000055a1044cd7f0 R10: 0000000000001000 R11: 0000000000000202 R12: 00007fff3a688ac0 R13: 00000000000000ff R14: 000055a102fc41c4 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: f2 4c 89 ee repnz mov %r13,%rsi 4: 4c 89 e7 mov %r12,%rdi 7: e8 11 eb ff ff callq 0xffffeb1d c: 48 85 db test %rbx,%rbx f: 0f 85 95 00 00 00 jne 0xaa 15: 9c pushfq 16: 58 pop %rax 17: f6 c4 02 test $0x2,%ah 1a: 0f 85 b9 00 00 00 jne 0xd9 20: 48 85 db test %rbx,%rbx 23: 74 01 je 0x26 25: fb sti 26: 48 83 c4 20 add $0x20,%rsp * 2a: 5b pop %rbx <-- trapping instruction 2b: 5d pop %rbp 2c: 41 5c pop %r12 2e: 41 5d pop %r13 30: 41 5e pop %r14 32: 41 5f pop %r15 34: c3 retq 35: f7 c5 ff 0f 00 00 test $0xfff,%ebp 3b: 0f .byte 0xf 3c: 85 60 ff test %esp,-0x1(%rax) 3f: ff .byte 0xff