BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1497 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 10598, name: syz.0.1711 2 locks held by syz.0.1711/10598: #0: ffff888077ae7ab8 (&nft_net->commit_mutex){+.+.}-{3:3}, at: nf_tables_valid_genid+0x37/0x100 net/netfilter/nf_tables_api.c:10049 #1: ffffffff8d1448f8 (css_set_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:389 [inline] #1: ffffffff8d1448f8 (css_set_lock){..-.}-{2:2}, at: cgroup_get_from_path+0x26/0x2f0 kernel/cgroup/cgroup.c:6655 irq event stamp: 204 hardirqs last enabled at (203): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (203): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (204): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (204): [] _raw_spin_lock_irq+0x86/0xf0 kernel/locking/spinlock.c:170 softirqs last enabled at (184): [] local_bh_enable+0x5/0x20 include/linux/bottom_half.h:31 softirqs last disabled at (164): [] local_bh_disable+0x5/0x20 include/linux/bottom_half.h:18 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 10598 Comm: syz.0.1711 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 ___might_sleep+0x493/0x610 kernel/sched/core.c:9658 down_read+0x20/0x2e0 kernel/locking/rwsem.c:1497 kernfs_walk_and_get_ns+0x7e/0x2c0 fs/kernfs/dir.c:908 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x5f/0x2f0 kernel/cgroup/cgroup.c:6657 cgroup_mt_check_v2+0x1f6/0x300 net/netfilter/xt_cgroup.c:111 xt_check_match+0x499/0xc50 net/netfilter/x_tables.c:534 __nft_match_init+0x619/0x820 net/netfilter/nft_compat.c:520 nft_match_large_init+0xbc/0x140 net/netfilter/nft_compat.c:542 nf_tables_newexpr net/netfilter/nf_tables_api.c:3000 [inline] nf_tables_newrule+0x16cc/0x27a0 net/netfilter/nf_tables_api.c:3733 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:514 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:634 [inline] nfnetlink_rcv+0x1117/0x2450 net/netfilter/nfnetlink.c:652 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x804/0x9e0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x8ba/0xbe0 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:706 [inline] __sock_sendmsg net/socket.c:718 [inline] ____sys_sendmsg+0x5be/0x8f0 net/socket.c:2446 ___sys_sendmsg+0x236/0x2e0 net/socket.c:2500 __sys_sendmsg net/socket.c:2529 [inline] __do_sys_sendmsg net/socket.c:2538 [inline] __se_sys_sendmsg+0x1b7/0x2a0 net/socket.c:2536 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f5f32a1ff19 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5f30c6d028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f5f32c9cfa0 RCX: 00007f5f32a1ff19 RDX: 0000000020040040 RSI: 0000200000000340 RDI: 0000000000000003 RBP: 00007f5f32aaef6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5f32c9d038 R14: 00007f5f32c9cfa0 R15: 00007ffeee1cd5f8 ============================= [ BUG: Invalid wait context ] syzkaller #0 Tainted: G W ----------------------------- syz.0.1711/10598 is trying to lock: ffffffff8d24fbd0 (kernfs_rwsem){++++}-{3:3}, at: kernfs_walk_and_get_ns+0x7e/0x2c0 fs/kernfs/dir.c:908 other info that might help us debug this: context-{4:4} 2 locks held by syz.0.1711/10598: #0: ffff888077ae7ab8 (&nft_net->commit_mutex){+.+.}-{3:3}, at: nf_tables_valid_genid+0x37/0x100 net/netfilter/nf_tables_api.c:10049 #1: ffffffff8d1448f8 (css_set_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:389 [inline] #1: ffffffff8d1448f8 (css_set_lock){..-.}-{2:2}, at: cgroup_get_from_path+0x26/0x2f0 kernel/cgroup/cgroup.c:6655 stack backtrace: CPU: 1 PID: 10598 Comm: syz.0.1711 Tainted: G W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 print_lock_invalid_wait_context kernel/locking/lockdep.c:4737 [inline] check_wait_context kernel/locking/lockdep.c:4798 [inline] __lock_acquire+0x1810/0x7d40 kernel/locking/lockdep.c:5070 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 kernfs_walk_and_get_ns+0x7e/0x2c0 fs/kernfs/dir.c:908 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x5f/0x2f0 kernel/cgroup/cgroup.c:6657 cgroup_mt_check_v2+0x1f6/0x300 net/netfilter/xt_cgroup.c:111 xt_check_match+0x499/0xc50 net/netfilter/x_tables.c:534 __nft_match_init+0x619/0x820 net/netfilter/nft_compat.c:520 nft_match_large_init+0xbc/0x140 net/netfilter/nft_compat.c:542 nf_tables_newexpr net/netfilter/nf_tables_api.c:3000 [inline] nf_tables_newrule+0x16cc/0x27a0 net/netfilter/nf_tables_api.c:3733 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:514 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:634 [inline] nfnetlink_rcv+0x1117/0x2450 net/netfilter/nfnetlink.c:652 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x804/0x9e0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x8ba/0xbe0 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:706 [inline] __sock_sendmsg net/socket.c:718 [inline] ____sys_sendmsg+0x5be/0x8f0 net/socket.c:2446 ___sys_sendmsg+0x236/0x2e0 net/socket.c:2500 __sys_sendmsg net/socket.c:2529 [inline] __do_sys_sendmsg net/socket.c:2538 [inline] __se_sys_sendmsg+0x1b7/0x2a0 net/socket.c:2536 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f5f32a1ff19 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5f30c6d028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f5f32c9cfa0 RCX: 00007f5f32a1ff19 RDX: 0000000020040040 RSI: 0000200000000340 RDI: 0000000000000003 RBP: 00007f5f32aaef6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5f32c9d038 R14: 00007f5f32c9cfa0 R15: 00007ffeee1cd5f8 xt_cgroup: invalid path, errno=-2