syzbot


WARNING in nft_socket_init (2)

Status: upstream: reported C repro on 2025/07/25 12:46
Subsystems: netfilter
[Documentation on labels]
Reported-by: syzbot+a225fea35d7baf8dbdc3@syzkaller.appspotmail.com
Fix commit: 1dee968d22ea netfilter: nft_socket: remove WARN_ON_ONCE with huge level value
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci-upstream-rust-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 48d, last: 30d
Cause bisection: introduced by (bisect log) :
commit 7f3287db654395f9c5ddd246325ff7889f550286
Author: Florian Westphal <fw@strlen.de>
Date: Sat Sep 7 14:07:49 2024 +0000

  netfilter: nft_socket: make cgroupsv2 matching work with namespaces

Crash: WARNING in nft_socket_init (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH net 7/7] netfilter: nft_socket: remove WARN_ON_ONCE with huge level value 1 (1) 2025/08/07 11:29
[PATCH nf] netfilter: nft_socket: remove WARN_ON_ONCE with giant cgroup tree 1 (1) 2025/08/07 10:05
[syzbot] [netfilter?] WARNING in nft_socket_init (2) 2 (4) 2025/07/26 01:43
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in nft_socket_init netfilter -1 C done 14 222d 290d 28/29 fixed on 2025/05/06 15:33

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5853 at net/netfilter/nft_socket.c:220 nft_socket_init+0x2f4/0x3d0 net/netfilter/nft_socket.c:220
Modules linked in:
CPU: 0 UID: 0 PID: 5853 Comm: syz-executor145 Not tainted 6.16.0-rc6-syzkaller-01673-g94619ea2d933 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:nft_socket_init+0x2f4/0x3d0 net/netfilter/nft_socket.c:220
Code: 84 c0 0f 85 da 00 00 00 41 88 2c 24 bd 08 00 00 00 e9 ad fe ff ff 89 f3 e8 29 86 07 f8 89 d8 e9 57 ff ff ff e8 1d 86 07 f8 90 <0f> 0b 90 e9 44 ff ff ff 89 e9 80 e1 07 38 c1 0f 8c 87 fd ff ff 48
RSP: 0018:ffffc9000401f178 EFLAGS: 00010293
RAX: ffffffff89b8a433 RBX: ffff888077f68020 RCX: ffff888030a8da00
RDX: 0000000000000000 RSI: 0000000000000100 RDI: 00000000000000ff
RBP: 00000000000000ff R08: 0000000000000000 R09: ffffffff89b8b21c
R10: dffffc0000000000 R11: ffffed10299a8e5b R12: 0000000000000100
R13: ffff8880352ec898 R14: dffffc0000000000 R15: 1ffff1100efed004
FS:  000055555942b380(0000) GS:ffff888125c15000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000000000 CR3: 0000000034702000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 nf_tables_newexpr net/netfilter/nf_tables_api.c:3496 [inline]
 nf_tables_newrule+0x178f/0x2890 net/netfilter/nf_tables_api.c:4327
 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:524 [inline]
 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:647 [inline]
 nfnetlink_rcv+0x112f/0x2520 net/netfilter/nfnetlink.c:665
 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
 netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346
 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896
 sock_sendmsg_nosec net/socket.c:714 [inline]
 __sock_sendmsg+0x219/0x270 net/socket.c:729
 ____sys_sendmsg+0x505/0x830 net/socket.c:2614
 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668
 __sys_sendmsg net/socket.c:2700 [inline]
 __do_sys_sendmsg net/socket.c:2705 [inline]
 __se_sys_sendmsg net/socket.c:2703 [inline]
 __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7efdcf55c0e9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 18 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff48ea8a28 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007efdcf55c0e9
RDX: 0000000000000000 RSI: 0000200000000000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007efdcf5a5036
R13: 00007fff48ea8a60 R14: 00007fff48ea8aa0 R15: 0000000000000000
 </TASK>

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/25 06:10 net-next 94619ea2d933 fb8f743d .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in nft_socket_init
2025/07/25 03:25 net-next 94619ea2d933 fb8f743d .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in nft_socket_init
2025/07/26 02:55 linux-next d086c886ceb9 fb8f743d .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce WARNING in nft_socket_init
2025/08/12 03:00 upstream 8f5ae30d69d7 32a0e5ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING in nft_socket_init
2025/08/06 06:24 net ad21f668e8d4 904e669c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in nft_socket_init
2025/07/25 01:52 net-next 94619ea2d933 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in nft_socket_init
* Struck through repros no longer work on HEAD.