Article View: linux.kernel.netdev
Article #8441Re: [PATCH net v2] ipv6: fix dead half of the MTU guard in __ip6_append_data()
From: bo cao
Date: Thu, 29 Oct 2026 02:44
Date: Thu, 29 Oct 2026 02:44
51 lines
11403 bytes
11403 bytes
Hi!
Both points, for the record:
How it was found: LLM-assisted manual review of the MTU guard in
__ip6_append_data(). The second half of the guard,
((mtu - fragheaderlen) & ~7) + fragheaderlen <=
sizeof(struct frag_hdr), is trivially false for any real
fragheaderlen (it compares an expression dominated by fragheaderlen
against the constant 8), which led to a closer look at what that
comparison was supposed to protect against.
It was actually triggered. Reproduced on a stock Ubuntu
7.3.0-9-generic kernel (arm64, QEMU) with a plain raw socket
(CAP_NET_RAW), no KASAN needed:
- setsockopt(IPV6_MTU, 1281) on a route whose fragheaderlen is 1280
(a 1240-byte Hop-by-Hop options cmsg), MSG_MORE, egress device
without NETIF_F_SG:
skbuff: skb_over_panic: text:... len:61280 put:61280
head:... tail:0xef78 end:0x6c0 dev:<NULL>
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:214!
Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
CPU: 3 UID: 0 PID: 1378 Comm: ipv6_maxfraglen
pc : skb_panic+0x5c/0x60
Call trace:
skb_panic+0x5c/0x60 (P)
skb_put+0x9c/0xa8
__ip6_append_data+0xf80/0x1948
ip6_append_data+0x94/0x2a8
rawv6_sendmsg+0x588/0x988
inet_sendmsg+0x4c/0xa8
__sock_sendmsg+0x78/0x100
____sys_sendmsg+0x268/0x308
...
(put:61280 = 60000 payload + 1280 fragheaderlen, exactly the wrap
predicted by the dead comparison)
- negative control, same setup with IPV6_MTU = 1288 (delta 8, just
outside the broken window): sendmsg() returns -EMSGSIZE cleanly,
no crash. The crash/-EMSGSIZE boundary sits exactly where the
dead comparison should have been checking.
The v2 guard rejects both: maxfraglen < fragheaderlen +
sizeof(struct frag_hdr) + 8 -> -EMSGSIZE. The xfrm transport-mode
variant pointed out in the review of v1 is code-inspection only; it
was not triggered at runtime.
Technical Details
Message-ID:
<tencent_365DE7BE440AE36819A526302155B355CE0A@qq.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353135-linux-kernel-netdev=dewy.ruReferences:
<179324160941.3327.14128311361745862229@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353135-linux-kernel-netdev=dewy.ru From: treebacker@foxmail.com (bo cao) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2] ipv6: fix dead half of the MTU guard in __ip6_append_data() Date: Thu, 29 Oct 2026 10:44:15 +0800 Organization: Usenet Network Message-ID: <tencent_365DE7BE440AE36819A526302155B355CE0A@qq.com> References: <179324160941.3327.14128311361745862229@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1920911"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Zgbk/idoNPUZM7LRqMiTA7vyh1w= sha256:NuX5nyg1oUpsz/S5NOqDFChC6VVrFpouLjThAXSHK64= sha1:jHMp4S0kTo4YWysxzX6sZolF/8A= sha256:epZTwkMH/v4wxV6HSKnjYd8oFNw3E/D5vhb7+IgbdWY= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1826B125C51; Thu, 29 Oct 2026 05:45:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.047 X-Spam-Status: No, score=-3.047 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=foxmail.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F-_pY8VvtPVc; Thu, 29 Oct 2026 05:45:30 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353135-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=foxmail.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 7D366125C44; Thu, 29 Oct 2026 05:45:20 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id DDC2B277F2; Thu, 29 Oct 2026 02:44:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793241866; b=Z+CBvc2MqM3BwfEGwzfU1t1k87151O+PJ9O/7Z7zlrkThAwmnYoo9aza9jvxr+MhfCF9 GW7PhRuT0z6aDePYxU+/YA04TS6cuVtEQ47TCpp/ncDxwamISROnk9qnByI06Ua+0JQba 12uKrlJLIntdt1buRsGQyHWfjhQHIqTUlGXtvzFPe6VeGWIMQOFfPnmb9NQlI+JjlUXlO MPnZlZnnqDWgusNgRPItaMiWI4560dLl0ESJeMfRmcGyGvHgKCdhmq46TI3eK0N7scADk +pNI4b4feROE/io/ALfbw4/Ub5gFe6YmegKjNKGdbrWHguWUT369tNwWHrLDPo8e8Sg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793241866; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:X-QQ-mid: Message-ID:X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Cc:Subject:Date: X-OQ-MSGID:X-Mailer:In-Reply-To:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Transfer-Encoding; bh=/C3ujp+ELk6cWY49J49ntJXJJ00OgMPF/+VSpV20OUw=; b=mwybKI4xPk1RXUVGOjWMvLmcItOowafFp97mPcnjK2fQAg+/YrBLUF9yUr/zlAshQGpu P3WOzUHFnutj7nbUzKsQPc3ib51fUJOU5E+uA/z/Hd0HZkRSCrVuggUDNtwJVQ/Ia7d0j ksH25jabFxyG3odhGmPAtgWf66EuSWIuwFWkZglaHrVwilPnIXmpcSv7pbv+bLehw0aGg vTwbw33unNV97AR/SqW2pC2iHQ1H13VxZ1qffmsjXDQ7mYMwoZZ+pdJKKe0nPQ7TkB69A 4KO39W35yIpKgDQHpuaXoKEODgd6ZrDVxG+1kbBCSWE2cm2iMaI/K1VF2o8z2t3esRg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b="Y156L0/R"; dmarc=pass header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE3ED606A31A; Thu, 29 Oct 2026 02:44:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b=Y156L0/R X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=162.62.57.252 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793241865; b=q2YTxqDuP+ihBvHDM+C2dEvB9kQ6KChjXkPwpxg/dyGhMyli9hgwMOPXmpHerq+HvcSQ aCaB6jyorf/XPLaZuQtRAiSjyJfsFKAEk2NIDPNoGychZeB+u23xzwQ3pIElJvX6lfYHb TUOciCmpBsWC0+ONFhdwnSLVvHxeLiGhVjrIjuU084MaCRf3/Z1GGpmTasb0AAzzaZTVZ syk7O1fJQIq+Fh5uxeVNSRsBCHcSmSvWNpFUOWm9oJN/FlxH0GgkFHOsWxow8ZBRgPjfP mM967qXRuGoRMHlMOmuuAXhvcMyxY6n5ZpuzB8hGVbK6Ftnpl4qYk1NKhbz9hbzNi4w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793241865; h=DMARC-Filter:DKIM-Signature:Received:X-QQ-mid:Message-ID: X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Cc:Subject:Date:X-OQ-MSGID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=/C3ujp+ELk6cWY49J49ntJXJJ00OgMPF/+VSpV20OUw=; b=eQG74xgnceE1IXem1IOaJR6u3bw+iuahVefGbL4o+QuOLn65pAKAOdLTPILhfT34QxmM /mLvmsKgPAmYZlq1WgWtt4vDZXIIgtxpbdnQsNZZQNXVhGe2qSSG+fuQ3hIsYVW4FN2q2 s3bfd3UKSp3thAgj7JagKoNtZmIbpGSHS2zvocqR9fTv0JGXKkYIad2yj0g61tRBKgXwZ kOs7dlfI9ge+BFDaTuYo/rz21xcOC6YWSwD8+4v4iqBdhQk6Hn9+REy3aaZY4gSkPbymr sI2kLuxhJEOGGNsq6P+Xdl7c3QQXvG4JxSGzCBW7gwskmY3OgCTT6UMMuv1CF41wq+A== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b="Y156L0/R"; arc=none smtp.remote-ip=162.62.57.252 X-Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F9E5606A31D; Thu, 29 Oct 2026 02:44:22 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1F9E5606A31D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1793241858; bh=/C3ujp+ELk6cWY49J49ntJXJJ00OgMPF/+VSpV20OUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y156L0/RA4vBrOpqSKuRn0XxErIB/85DOZrztqR3BCEUtDLTPMFi/D96joES+62Ga j4+WC0xAqrI0GeQubLmD8e9VVMYe7N8vMBg3GLPfnbiMQ1XrPcWJb94gSq6zr+OImj de4l4FvP+H4F9OLCe9L6d6YWXUrz0zZGk1tW+FrY= X-Received: from HAPYCAO-MC1.tencent.com ([61.151.228.146]) by newxmesmtplogicsvrszb51-0.qq.com (NewEsmtp) with SMTP id B101D0E5; Thu, 29 Oct 2026 10:44:16 +0800 X-QQ-mid: xmsmtpt1793241856t59axzimr X-QQ-XMAILINFO: MDbayGdXPuoeHYdrtKaC9TgtzSqfUBYydqPt+7wm7Vhf3I5yzRiKgUY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DrX8WssuA wpQhhh X-QQ-XMRINFO: NyFYKkN4Ny6FuXrnB5Ye7Aabb3ujjtK+gg== X-Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, stable@vger.kernel.org X-OQ-MSGID: <20261029024415.33250-1-treebacker@foxmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) X-In-Reply-To: <179324160941.3327.14128311361745862229@kernel.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list