================================ WARNING: inconsistent lock state 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor174/12174 [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: 5747 hardirqs last enabled at (5746): [] mod_memcg_state include/linux/memcontrol.h:982 [inline] hardirqs last enabled at (5746): [] memcg_account_kmem+0x4f/0x80 mm/memcontrol.c:3094 hardirqs last disabled at (5747): [] uncharge_batch+0x1c7/0x560 mm/memcontrol.c:7142 softirqs last enabled at (5314): [] spin_unlock_bh include/linux/spinlock.h:395 [inline] softirqs last enabled at (5314): [] qdisc_reset_all_tx_gt include/net/sch_generic.h:726 [inline] softirqs last enabled at (5314): [] netif_set_real_num_tx_queues+0x3d1/0x8d0 net/core/dev.c:2893 softirqs last disabled at (5589): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (5589): [] __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-executor174/12174: #0: ffffffff8e10b4a8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:78 [inline] #0: ffffffff8e10b4a8 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x3e8/0xd50 net/core/rtnetlink.c:6414 #1: ffffffff8c796100 (rcu_read_lock){....}-{1:2}, at: batadv_hardif_get_by_netdev+0x4/0x440 net/batman-adv/hard-interface.c:66 #2: ffffffff8c795fe0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2104 [inline] #2: ffffffff8c795fe0 (rcu_callback){....}-{0:0}, at: rcu_core+0x791/0x1ad0 kernel/rcu/tree.c:2377 stack backtrace: CPU: 0 PID: 12174 Comm: syz-executor174 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:batadv_hardif_get_by_netdev+0xff/0x440 net/batman-adv/hard-interface.c:70 Code: 00 00 4c 8b 25 d2 57 43 08 48 8d 44 24 30 48 bb 00 00 00 00 00 fc ff df 48 89 04 24 49 81 fc a0 34 1c 92 75 2c e9 c2 01 00 00 bc 8a aa f7 4c 89 e0 48 c1 e8 03 80 3c 18 00 0f 85 f7 02 00 00 RSP: 0018:ffffc9002054eeb8 EFLAGS: 00000287 RAX: 1ffff1100c046203 RBX: dffffc0000000000 RCX: 0000000000000000 RDX: ffff88801cb45100 RSI: ffffffff89d8dd1b RDI: ffff888060231018 RBP: ffff88813aae0000 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: ffff888060231000 R13: ffff88813aae0000 R14: ffffffff8e5bb800 R15: 0000000000000000 batadv_hard_if_event+0x94/0x15e0 net/batman-adv/hard-interface.c:949 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers+0x7d/0xb0 net/core/dev.c:1987 xdp_set_features_flag+0xb8/0xe0 net/core/xdp.c:785 veth_set_xdp_features+0x12d/0x250 drivers/net/veth.c:1327 veth_newlink+0x731/0x9d0 drivers/net/veth.c:1953 rtnl_newlink_create net/core/rtnetlink.c:3465 [inline] __rtnl_newlink+0x10c2/0x1840 net/core/rtnetlink.c:3682 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3695 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6417 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2546 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 ____sys_sendmsg+0x71c/0x900 net/socket.c:2503 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2557 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2586 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:0x7f6c1868df49 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 15 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 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff67c64f68 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f6c1868df49 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 0000000000000000 R08: 00007fff67c64f90 R09: 00007fff67c64f90 R10: 00007fff67c64f90 R11: 0000000000000246 R12: 00007fff67c64f8c R13: 00007fff67c64fa0 R14: 00007fff67c64fe0 R15: 00000000000006d2 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 4c 8b 25 d2 57 43 08 mov 0x84357d2(%rip),%r12 # 0x84357db 9: 48 8d 44 24 30 lea 0x30(%rsp),%rax e: 48 bb 00 00 00 00 00 movabs $0xdffffc0000000000,%rbx 15: fc ff df 18: 48 89 04 24 mov %rax,(%rsp) 1c: 49 81 fc a0 34 1c 92 cmp $0xffffffff921c34a0,%r12 23: 75 2c jne 0x51 25: e9 c2 01 00 00 jmpq 0x1ec * 2a: e8 bc 8a aa f7 callq 0xf7aa8aeb <-- trapping instruction 2f: 4c 89 e0 mov %r12,%rax 32: 48 c1 e8 03 shr $0x3,%rax 36: 80 3c 18 00 cmpb $0x0,(%rax,%rbx,1) 3a: 0f 85 f7 02 00 00 jne 0x337