kernel BUG in nf_ip6_checksum
Subsystems (3)
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: eabc76156e86 Merge branch 'net-dsa-mv88e6xxx-ethtool-n-tup.. git tree: net-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=102d1405580000 kernel config: https://syzkaller.appspot.com/x/.config?x=7a013aa2165022bf dashboard link: https://syzkaller.appspot.com/bug?extid=5a8667f002726fc59f88 compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=122d1405580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15c58c5e580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1d4c5734556a/disk-eabc7615.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5c68f2f68d0d/vmlinux-eabc7615.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f4fc253f3897/bzImage-eabc7615.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
ip6_tables: ip6tables: counters copy to user failed while replacing table
------------[ cut here ]------------ kernel BUG at net/core/skbuff.c:3606! Oops: invalid opcode: 0000 [#1] SMP KASAN PTI CPU: 0 UID: 0 PID: 5631 Comm: syz-executor206 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 RIP: 0010:skb_checksum+0x8b2/0x8c0 net/core/skbuff.c:3606 Code: c4 3d 8c f8 e9 43 f9 ff ff 44 89 f9 80 e1 07 38 c1 0f 8c 59 f9 ff ff 4c 89 ff e8 49 3d 8c f8 e9 4c f9 ff ff e8 ef 35 1c f8 90 <0f> 0b 66 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90003a3f000 EFLAGS: 00010293 RAX: ffffffff89ab9c91 RBX: 000000000000053c RCX: ffff88807f8abe80 RDX: 0000000000000000 RSI: 000000000000053c RDI: 0000000000000000 RBP: dffffc0000000000 R08: ffff88807f8abe80 R09: 0000000000000002 R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000000 R13: 000000000000003c R14: 000000000000003c R15: 0000000000000578 FS: 0000555590f26400(0000) GS:ffff888124cca000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556b4bcc5000 CR3: 000000006f904000 CR4: 00000000003526f0 Call Trace: <TASK> nf_ip6_checksum+0x1bd/0x320 net/netfilter/utils.c:89 synproxy_tg6+0x1a4/0x6e0 net/ipv6/netfilter/ip6t_SYNPROXY.c:21 ip6t_do_table+0xd37/0x15b0 net/ipv6/netfilter/ip6_tables.c:366 nf_hook_entry_hookfn include/linux/netfilter.h:165 [inline] nf_hook_slow+0xc5/0x220 net/netfilter/core.c:619 nf_hook include/linux/netfilter.h:280 [inline] NF_HOOK+0x21f/0x3c0 include/linux/netfilter.h:323 ip6_input+0x16a/0x270 net/ipv6/ip6_input.c:545 NF_HOOK+0x336/0x3c0 include/linux/netfilter.h:325 __netif_receive_skb_one_core net/core/dev.c:6264 [inline] __netif_receive_skb net/core/dev.c:6377 [inline] netif_receive_skb_internal net/core/dev.c:6463 [inline] netif_receive_skb+0x278/0xbf0 net/core/dev.c:6522 tun_rx_batched+0x1de/0x790 drivers/net/tun.c:1571 tun_get_user+0x2be0/0x44d0 drivers/net/tun.c:2045 tun_chr_write_iter+0x113/0x200 drivers/net/tun.c:2091 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f993fdff367 Code: 48 89 fa 4c 89 df e8 78 1e 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007ffcd131e8b0 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000555590f26400 RCX: 00007f993fdff367 RDX: 000000000000004a RSI: 0000200000000500 RDI: 00000000000000c8 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f993fe6ebe0 R15: 0000000000000002 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:skb_checksum+0x8b2/0x8c0 net/core/skbuff.c:3606 Code: c4 3d 8c f8 e9 43 f9 ff ff 44 89 f9 80 e1 07 38 c1 0f 8c 59 f9 ff ff 4c 89 ff e8 49 3d 8c f8 e9 4c f9 ff ff e8 ef 35 1c f8 90 <0f> 0b 66 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90003a3f000 EFLAGS: 00010293 RAX: ffffffff89ab9c91 RBX: 000000000000053c RCX: ffff88807f8abe80 RDX: 0000000000000000 RSI: 000000000000053c RDI: 0000000000000000 RBP: dffffc0000000000 R08: ffff88807f8abe80 R09: 0000000000000002 R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000000 R13: 000000000000003c R14: 000000000000003c R15: 0000000000000578 FS: 0000555590f26400(0000) GS:ffff888124cca000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556b4bcc5000 CR3: 000000006f904000 CR4: 00000000003526f0
---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
#syz fix: ipv6: do not let ipv6_find_hdr() return an offset past the packet end
The bad thoff passed to nf_ip6_checksum() comes from ipv6_find_hdr(), which commit ee319bd3a0e9 fixed in v7.3-rc5 (as Pablo noted in the synproxy patch thread). syzbot has not seen this crash since then.
I checked it with the C reproducer on v7.4-rc5 (CONFIG_DEBUG_NET=y):
- with ee319bd3a0e9 reverted, synproxy_tg6() is reached with thoff=1400 for a 60-byte skb and skb_checksum() warns at net/core/skbuff.c:3627 (the former BUG_ON became DEBUG_NET_WARN_ON_ONCE in 20ddd0fd2fcd), call trace nf_ip6_checksum <- synproxy_tg6 <- ip6t_do_table;
- with ee319bd3a0e9 applied, 3 of 3 runs are clean.
The synproxy hardening patch ("netfilter: synproxy: check TCP header before verifying checksum") is unaffected by this; Pablo already suggested it for nf-next.
The analysis was done with the help of an AI assistant (Claude); I reviewed the results.
Björn