BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:49 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 16, name: ksoftirqd/0 preempt_count: 100, expected: 0 RCU nest depth: 0, expected: 0 1 lock held by ksoftirqd/0/16: #0: ffffffff8e937560 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #0: ffffffff8e937560 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2561 [inline] #0: ffffffff8e937560 (rcu_callback){....}-{0:0}, at: rcu_core+0xa37/0x17a0 kernel/rcu/tree.c:2823 Preemption disabled at: [] softirq_handle_begin kernel/softirq.c:402 [inline] [] handle_softirqs+0x128/0x9b0 kernel/softirq.c:537 CPU: 0 UID: 0 PID: 16 Comm: ksoftirqd/0 Not tainted 6.13.0-rc1-next-20241203-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 __might_resched+0x5d4/0x780 kernel/sched/core.c:8760 percpu_down_read include/linux/percpu-rwsem.h:49 [inline] cpus_read_lock+0x1b/0x150 kernel/cpu.c:490 __static_key_slow_dec kernel/jump_label.c:320 [inline] static_key_slow_dec+0x49/0xa0 kernel/jump_label.c:336 nf_tables_chain_destroy+0x3c4/0x4f0 net/netfilter/nf_tables_api.c:2263 __nft_release_basechain_now net/netfilter/nf_tables_api.c:11695 [inline] nft_release_basechain_rcu+0x3fc/0x550 net/netfilter/nf_tables_api.c:11707 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 ================================ WARNING: inconsistent lock state 6.13.0-rc1-next-20241203-syzkaller #0 Tainted: G W -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-R} usage. ksoftirqd/0/16 [HC0[0]:SC1[1]:HE1:SE0] takes: ffffffff8e7d26b0 (cpu_hotplug_lock){+++?}-{0:0}, at: __static_key_slow_dec kernel/jump_label.c:320 [inline] (cpu_hotplug_lock){+++?}-{0:0}, at: static_key_slow_dec+0x49/0xa0 kernel/jump_label.c:336 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 percpu_down_write+0x54/0x310 kernel/locking/percpu-rwsem.c:229 cpus_write_lock kernel/cpu.c:508 [inline] _cpu_up+0x76/0x580 kernel/cpu.c:1639 cpu_up+0x184/0x230 kernel/cpu.c:1723 cpuhp_bringup_mask+0xdf/0x260 kernel/cpu.c:1789 cpuhp_bringup_cpus_parallel+0xaf/0x160 kernel/cpu.c:1867 bringup_nonboot_cpus+0x2b/0x50 kernel/cpu.c:1893 smp_init+0x34/0x150 kernel/smp.c:1009 kernel_init_freeable+0x417/0x5d0 init/main.c:1569 kernel_init+0x1d/0x2b0 init/main.c:1466 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 irq event stamp: 2580942 hardirqs last enabled at (2580942): [] irqentry_exit+0x63/0x90 kernel/entry/common.c:357 hardirqs last disabled at (2580941): [] common_interrupt+0x13/0xd0 arch/x86/kernel/irq.c:278 softirqs last enabled at (2580764): [] run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 softirqs last disabled at (2580769): [] run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(cpu_hotplug_lock); lock(cpu_hotplug_lock); *** DEADLOCK *** 1 lock held by ksoftirqd/0/16: #0: ffffffff8e937560 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #0: ffffffff8e937560 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2561 [inline] #0: ffffffff8e937560 (rcu_callback){....}-{0:0}, at: rcu_core+0xa37/0x17a0 kernel/rcu/tree.c:2823 stack backtrace: CPU: 0 UID: 0 PID: 16 Comm: ksoftirqd/0 Tainted: G W 6.13.0-rc1-next-20241203-syzkaller #0 Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_usage_bug+0x62e/0x8b0 kernel/locking/lockdep.c:4038 valid_state+0x13a/0x1c0 kernel/locking/lockdep.c:4052 mark_lock_irq+0xbb/0xc20 kernel/locking/lockdep.c:4263 mark_lock+0x223/0x360 kernel/locking/lockdep.c:4749 __lock_acquire+0xc02/0x2100 kernel/locking/lockdep.c:5180 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] cpus_read_lock+0x42/0x150 kernel/cpu.c:490 __static_key_slow_dec kernel/jump_label.c:320 [inline] static_key_slow_dec+0x49/0xa0 kernel/jump_label.c:336 nf_tables_chain_destroy+0x3c4/0x4f0 net/netfilter/nf_tables_api.c:2263 __nft_release_basechain_now net/netfilter/nf_tables_api.c:11695 [inline] nft_release_basechain_rcu+0x3fc/0x550 net/netfilter/nf_tables_api.c:11707 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 16 at kernel/smp.c:815 smp_call_function_many_cond+0x251a/0x2c60 kernel/smp.c:815 Modules linked in: CPU: 0 UID: 0 PID: 16 Comm: ksoftirqd/0 Tainted: G W 6.13.0-rc1-next-20241203-syzkaller #0 Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 RIP: 0010:smp_call_function_many_cond+0x251a/0x2c60 kernel/smp.c:815 Code: ff ff e8 79 e0 0b 00 e9 5d ee ff ff e8 6f e0 0b 00 e9 6c ff ff ff e8 65 e0 0b 00 90 0f 0b 90 e9 5d dc ff ff e8 57 e0 0b 00 90 <0f> 0b 90 e9 45 dd ff ff e8 49 e0 0b 00 90 0f 0b 90 e9 6b dd ff ff RSP: 0018:ffffc900001574c0 EFLAGS: 00010246 RAX: ffffffff81937df9 RBX: 0000000000000100 RCX: ffff88801befda00 RDX: 0000000000000100 RSI: 0000000000000100 RDI: 0000000000000000 RBP: ffffc900001576c0 R08: ffffffff81935b36 R09: 1ffffffff2033986 R10: dffffc0000000000 R11: fffffbfff2033987 R12: dffffc0000000000 R13: 0000000000000000 R14: ffffffff9019cc30 R15: 0000000000000003 FS: 0000000000000000(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020001480 CR3: 000000000e736000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: on_each_cpu_cond_mask+0x3f/0x80 kernel/smp.c:1051 on_each_cpu include/linux/smp.h:71 [inline] text_poke_sync arch/x86/kernel/alternative.c:2118 [inline] text_poke_bp_batch+0x352/0xb30 arch/x86/kernel/alternative.c:2328 text_poke_flush arch/x86/kernel/alternative.c:2519 [inline] text_poke_finish+0x30/0x50 arch/x86/kernel/alternative.c:2526 arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146 __static_key_slow_dec_cpuslocked+0xc4/0x110 kernel/jump_label.c:315 __static_key_slow_dec kernel/jump_label.c:321 [inline] static_key_slow_dec+0x51/0xa0 kernel/jump_label.c:336 nf_tables_chain_destroy+0x3c4/0x4f0 net/netfilter/nf_tables_api.c:2263 __nft_release_basechain_now net/netfilter/nf_tables_api.c:11695 [inline] nft_release_basechain_rcu+0x3fc/0x550 net/netfilter/nf_tables_api.c:11707 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244