BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1487 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 3961, name: syz-executor187 1 lock held by syz-executor187/3961: #0: ffff800014ae6a98 (css_set_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] #0: ffff800014ae6a98 (css_set_lock){....}-{2:2}, at: cgroup_get_from_path+0x30/0x300 kernel/cgroup/cgroup.c:6616 irq event stamp: 13312 hardirqs last enabled at (13311): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1338 [inline] hardirqs last enabled at (13311): [] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:4780 hardirqs last disabled at (13312): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (13312): [] _raw_spin_lock_irq+0x38/0x13c kernel/locking/spinlock.c:170 softirqs last enabled at (13286): [] spin_unlock_bh include/linux/spinlock.h:408 [inline] softirqs last enabled at (13286): [] release_sock+0x1e4/0x270 net/core/sock.c:3242 softirqs last disabled at (13284): [] spin_lock_bh include/linux/spinlock.h:368 [inline] softirqs last disabled at (13284): [] release_sock+0x3c/0x270 net/core/sock.c:3229 Preemption disabled at: [] spin_lock_irq include/linux/spinlock.h:388 [inline] [] cgroup_get_from_path+0x30/0x300 kernel/cgroup/cgroup.c:6616 CPU: 1 PID: 3961 Comm: syz-executor187 Not tainted 5.15.120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 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:9625 __might_sleep+0x98/0xf0 kernel/sched/core.c:9579 down_read+0x34/0x398 kernel/locking/rwsem.c:1487 kernfs_walk_and_get_ns+0x8c/0x310 fs/kernfs/dir.c:894 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x64/0x300 kernel/cgroup/cgroup.c:6618 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:1152 [inline] do_ip6t_set_ctl+0x9c4/0x2fd4 net/ipv6/netfilter/ip6_tables.c:1638 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:1664 sock_common_setsockopt+0xb0/0xcc net/core/sock.c:3409 __sys_setsockopt+0x3a8/0x6b4 net/socket.c:2179 __do_sys_setsockopt net/socket.c:2190 [inline] __se_sys_setsockopt net/socket.c:2187 [inline] __arm64_sys_setsockopt+0xb8/0xd4 net/socket.c:2187 __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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 ============================= [ BUG: Invalid wait context ] 5.15.120-syzkaller #0 Tainted: G W ----------------------------- syz-executor187/3961 is trying to lock: ffff800014be60d0 (kernfs_rwsem){++++}-{3:3}, at: kernfs_walk_and_get_ns+0x8c/0x310 fs/kernfs/dir.c:894 other info that might help us debug this: context-{4:4} 1 lock held by syz-executor187/3961: #0: ffff800014ae6a98 (css_set_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] #0: ffff800014ae6a98 (css_set_lock){....}-{2:2}, at: cgroup_get_from_path+0x30/0x300 kernel/cgroup/cgroup.c:6616 stack backtrace: CPU: 1 PID: 3961 Comm: syz-executor187 Tainted: G W 5.15.120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 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:4663 [inline] check_wait_context kernel/locking/lockdep.c:4724 [inline] __lock_acquire+0x1af4/0x7620 kernel/locking/lockdep.c:4961 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622 down_read+0xc0/0x398 kernel/locking/rwsem.c:1488 kernfs_walk_and_get_ns+0x8c/0x310 fs/kernfs/dir.c:894 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x64/0x300 kernel/cgroup/cgroup.c:6618 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:1152 [inline] do_ip6t_set_ctl+0x9c4/0x2fd4 net/ipv6/netfilter/ip6_tables.c:1638 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:1664 sock_common_setsockopt+0xb0/0xcc net/core/sock.c:3409 __sys_setsockopt+0x3a8/0x6b4 net/socket.c:2179 __do_sys_setsockopt net/socket.c:2190 [inline] __se_sys_setsockopt net/socket.c:2187 [inline] __arm64_sys_setsockopt+0xb8/0xd4 net/socket.c:2187 __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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 ip6t_rpfilter: only valid in 'raw' or 'mangle' table, not ' %w ='