#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
Re: [syzbot] [netfilter?] kernel BUG in nf_ip6_checksum
- From
- linu…@gmail.com (Björn Bärtschi)
- Organization
- Usenet Network
- Message-ID
- <2026…@gmail.com>
- Date
- Newsgroups
- linux.kernel.netdev