BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1497 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 5990, name: syz-executor.0 1 lock held by syz-executor.0/5990: #0: ffff800014b46918 (css_set_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] #0: ffff800014b46918 (css_set_lock){..-.}-{2:2}, at: cgroup_get_from_path+0x30/0x300 kernel/cgroup/cgroup.c:6620 irq event stamp: 348 hardirqs last enabled at (347): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (347): [] _raw_spin_unlock_irqrestore+0xac/0x158 kernel/locking/spinlock.c:194 hardirqs last disabled at (348): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (348): [] _raw_spin_lock_irq+0x38/0x13c kernel/locking/spinlock.c:170 softirqs last enabled at (304): [] spin_unlock_bh include/linux/spinlock.h:408 [inline] softirqs last enabled at (304): [] release_sock+0x1e4/0x270 net/core/sock.c:3276 softirqs last disabled at (302): [] spin_lock_bh include/linux/spinlock.h:368 [inline] softirqs last disabled at (302): [] release_sock+0x3c/0x270 net/core/sock.c:3263 Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:388 [inline] [] cgroup_get_from_path+0x30/0x300 kernel/cgroup/cgroup.c:6620 CPU: 1 PID: 5990 Comm: syz-executor.0 Not tainted 5.15.160-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 ___might_sleep+0x380/0x4dc kernel/sched/core.c:9626 __might_sleep+0x98/0xf0 kernel/sched/core.c:9580 down_read+0x34/0x398 kernel/locking/rwsem.c:1497 kernfs_walk_and_get_ns+0x8c/0x310 fs/kernfs/dir.c:908 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x64/0x300 kernel/cgroup/cgroup.c:6622 cgroup_mt_check_v1+0x18c/0x278 net/netfilter/xt_cgroup.c:56 xt_check_match+0x338/0x914 net/netfilter/x_tables.c:523 check_match net/ipv6/netfilter/ip6_tables.c:490 [inline] find_check_match net/ipv6/netfilter/ip6_tables.c:507 [inline] find_check_entry net/ipv6/netfilter/ip6_tables.c:558 [inline] translate_table+0x10cc/0x1ac8 net/ipv6/netfilter/ip6_tables.c:735 do_replace net/ipv6/netfilter/ip6_tables.c:1156 [inline] do_ip6t_set_ctl+0xb8c/0x1164 net/ipv6/netfilter/ip6_tables.c:1646 nf_setsockopt+0x270/0x290 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x1f28/0x3d84 net/ipv6/ipv6_sockglue.c:1011 udpv6_setsockopt+0xa8/0xc0 net/ipv6/udp.c:1681 sock_common_setsockopt+0xb0/0xcc net/core/sock.c:3443 __sys_setsockopt+0x3a8/0x6b4 net/socket.c:2198 __do_sys_setsockopt net/socket.c:2209 [inline] __se_sys_setsockopt net/socket.c:2206 [inline] __arm64_sys_setsockopt+0xb8/0xd4 net/socket.c:2206 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 ============================= [ BUG: Invalid wait context ] 5.15.160-syzkaller #0 Tainted: G W ----------------------------- syz-executor.0/5990 is trying to lock: ffff800014c46c10 (kernfs_rwsem){++++}-{3:3}, at: kernfs_walk_and_get_ns+0x8c/0x310 fs/kernfs/dir.c:908 other info that might help us debug this: context-{4:4} 1 lock held by syz-executor.0/5990: #0: ffff800014b46918 (css_set_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] #0: ffff800014b46918 (css_set_lock){..-.}-{2:2}, at: cgroup_get_from_path+0x30/0x300 kernel/cgroup/cgroup.c:6620 stack backtrace: CPU: 1 PID: 5990 Comm: syz-executor.0 Tainted: G W 5.15.160-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_lock_invalid_wait_context kernel/locking/lockdep.c:4664 [inline] check_wait_context kernel/locking/lockdep.c:4725 [inline] __lock_acquire+0x1af0/0x7638 kernel/locking/lockdep.c:4962 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623 down_read+0xc0/0x398 kernel/locking/rwsem.c:1498 kernfs_walk_and_get_ns+0x8c/0x310 fs/kernfs/dir.c:908 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x64/0x300 kernel/cgroup/cgroup.c:6622 cgroup_mt_check_v1+0x18c/0x278 net/netfilter/xt_cgroup.c:56 xt_check_match+0x338/0x914 net/netfilter/x_tables.c:523 check_match net/ipv6/netfilter/ip6_tables.c:490 [inline] find_check_match net/ipv6/netfilter/ip6_tables.c:507 [inline] find_check_entry net/ipv6/netfilter/ip6_tables.c:558 [inline] translate_table+0x10cc/0x1ac8 net/ipv6/netfilter/ip6_tables.c:735 do_replace net/ipv6/netfilter/ip6_tables.c:1156 [inline] do_ip6t_set_ctl+0xb8c/0x1164 net/ipv6/netfilter/ip6_tables.c:1646 nf_setsockopt+0x270/0x290 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x1f28/0x3d84 net/ipv6/ipv6_sockglue.c:1011 udpv6_setsockopt+0xa8/0xc0 net/ipv6/udp.c:1681 sock_common_setsockopt+0xb0/0xcc net/core/sock.c:3443 __sys_setsockopt+0x3a8/0x6b4 net/socket.c:2198 __do_sys_setsockopt net/socket.c:2209 [inline] __se_sys_setsockopt net/socket.c:2206 [inline] __arm64_sys_setsockopt+0xb8/0xd4 net/socket.c:2206 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 xt_cgroup: invalid path, errno=-2