BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1497 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 9969, name: syz.1.1367 2 locks held by syz.1.1367/9969: #0: ffff8880785e20e8 (&smc->clcsock_release_lock){+.+.}-{3:3}, at: smc_setsockopt+0x130/0xb20 net/smc/af_smc.c:2447 #1: ffffffff8cb456d8 (css_set_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] #1: ffffffff8cb456d8 (css_set_lock){..-.}-{2:2}, at: cgroup_get_from_path+0x24/0x2e0 kernel/cgroup/cgroup.c:6623 irq event stamp: 2340 hardirqs last enabled at (2339): [] asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676 hardirqs last disabled at (2340): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (2340): [] _raw_spin_lock_irq+0xa9/0x110 kernel/locking/spinlock.c:170 softirqs last enabled at (2334): [] __do_softirq kernel/softirq.c:592 [inline] softirqs last enabled at (2334): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (2334): [] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641 softirqs last disabled at (2317): [] __do_softirq kernel/softirq.c:592 [inline] softirqs last disabled at (2317): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (2317): [] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 9969 Comm: syz.1.1367 Not tainted 5.15.174-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 ___might_sleep+0x547/0x6a0 kernel/sched/core.c:9636 down_read+0x21/0x2e0 kernel/locking/rwsem.c:1497 kernfs_walk_and_get_ns+0x7e/0x2b0 fs/kernfs/dir.c:908 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x5c/0x2e0 kernel/cgroup/cgroup.c:6625 cgroup_mt_check_v1+0x1a0/0x2b0 net/netfilter/xt_cgroup.c:56 xt_check_match+0x363/0xa30 net/netfilter/x_tables.c:523 check_match net/ipv4/netfilter/ip_tables.c:472 [inline] find_check_match net/ipv4/netfilter/ip_tables.c:488 [inline] find_check_entry net/ipv4/netfilter/ip_tables.c:538 [inline] translate_table+0x15bd/0x2250 net/ipv4/netfilter/ip_tables.c:717 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline] do_ipt_set_ctl+0xdbc/0x1200 net/ipv4/netfilter/ip_tables.c:1636 nf_setsockopt+0x28a/0x2b0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x2732/0x3fb0 net/ipv4/ip_sockglue.c:1442 tcp_setsockopt+0x23f/0x3680 net/ipv4/tcp.c:3713 smc_setsockopt+0x1e5/0xb20 net/smc/af_smc.c:2455 __sys_setsockopt+0x57e/0x990 net/socket.c:2203 __do_sys_setsockopt net/socket.c:2214 [inline] __se_sys_setsockopt net/socket.c:2211 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2211 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f9051367d19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f904f1d8038 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f9051557fa0 RCX: 00007f9051367d19 RDX: 0000000000000040 RSI: 0004000000000000 RDI: 0000000000000008 RBP: 00007f90513e3a20 R08: 0000000000001378 R09: 0000000000000000 R10: 0000000020000640 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9051557fa0 R15: 00007ffc61d1f538 ============================= [ BUG: Invalid wait context ] 5.15.174-syzkaller #0 Tainted: G W ----------------------------- syz.1.1367/9969 is trying to lock: ffffffff8cc523f0 (kernfs_rwsem){++++}-{3:3}, at: kernfs_walk_and_get_ns+0x7e/0x2b0 fs/kernfs/dir.c:908 other info that might help us debug this: context-{4:4} 2 locks held by syz.1.1367/9969: #0: ffff8880785e20e8 (&smc->clcsock_release_lock){+.+.}-{3:3}, at: smc_setsockopt+0x130/0xb20 net/smc/af_smc.c:2447 #1: ffffffff8cb456d8 (css_set_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] #1: ffffffff8cb456d8 (css_set_lock){..-.}-{2:2}, at: cgroup_get_from_path+0x24/0x2e0 kernel/cgroup/cgroup.c:6623 stack backtrace: CPU: 0 PID: 9969 Comm: syz.1.1367 Tainted: G W 5.15.174-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_lock_invalid_wait_context kernel/locking/lockdep.c:4664 [inline] check_wait_context kernel/locking/lockdep.c:4725 [inline] __lock_acquire+0x14f5/0x1ff0 kernel/locking/lockdep.c:4962 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 kernfs_walk_and_get_ns+0x7e/0x2b0 fs/kernfs/dir.c:908 kernfs_walk_and_get include/linux/kernfs.h:559 [inline] cgroup_get_from_path+0x5c/0x2e0 kernel/cgroup/cgroup.c:6625 cgroup_mt_check_v1+0x1a0/0x2b0 net/netfilter/xt_cgroup.c:56 xt_check_match+0x363/0xa30 net/netfilter/x_tables.c:523 check_match net/ipv4/netfilter/ip_tables.c:472 [inline] find_check_match net/ipv4/netfilter/ip_tables.c:488 [inline] find_check_entry net/ipv4/netfilter/ip_tables.c:538 [inline] translate_table+0x15bd/0x2250 net/ipv4/netfilter/ip_tables.c:717 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline] do_ipt_set_ctl+0xdbc/0x1200 net/ipv4/netfilter/ip_tables.c:1636 nf_setsockopt+0x28a/0x2b0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x2732/0x3fb0 net/ipv4/ip_sockglue.c:1442 tcp_setsockopt+0x23f/0x3680 net/ipv4/tcp.c:3713 smc_setsockopt+0x1e5/0xb20 net/smc/af_smc.c:2455 __sys_setsockopt+0x57e/0x990 net/socket.c:2203 __do_sys_setsockopt net/socket.c:2214 [inline] __se_sys_setsockopt net/socket.c:2211 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2211 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f9051367d19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f904f1d8038 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f9051557fa0 RCX: 00007f9051367d19 RDX: 0000000000000040 RSI: 0004000000000000 RDI: 0000000000000008 RBP: 00007f90513e3a20 R08: 0000000000001378 R09: 0000000000000000 R10: 0000000020000640 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9051557fa0 R15: 00007ffc61d1f538 xt_cgroup: invalid path, errno=-2