Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 817C9333A9A for ; Wed, 17 Sep 2025 14:59:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758121189; cv=none; b=rXHZeyJMptSuoy40Eiof/lcmw75fcYGhGFXGC8bXaFisP92IHzUd64sPlaUWRNv47EDauvS+i/Myl1lS91IKczC8FpQsgOFWuC7JC5rk3tBb9LX1g2M0zfZ8llQpZMLPAbJNxOXBnYx4vaVaNIZlmFBH3d5lU3Y9XYWeXW5NWEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758121189; c=relaxed/simple; bh=fX4DyAcKjrFLr1VOcBzHUy0YNZhZdSYBkQymPJzWAi0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eM8wK1/ihhEyDg0tg0bmb5jpjwXkOhQ97zAOCh2tLg9JLLUzeXPMlgqz7gMnfNBdzqA5j+XDLVwwAlRuxqOz5rjnZ+/BGqh8cgsy+AXQ67MnYo5OhA3x8l2uDXzF2OxiUWtXjNw7pixl8g7OQXdqTo8w8wKGkQj1JyvCfh+1XKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=P1Z1Fj94; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="P1Z1Fj94" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC82FC4CEE7; Wed, 17 Sep 2025 14:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758121189; bh=fX4DyAcKjrFLr1VOcBzHUy0YNZhZdSYBkQymPJzWAi0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=P1Z1Fj94Vfbq6iHAIjzurHwb85KEkMH1DZKOhPAKh/st54rDOuSqKHjmzizdrKC62 jQtIZQo55V8wm7OCOH1H7+cbiBMpZZ1FTh1kPHC3V05e3C+qOAlgFWjfwLc7QZ9MQ2 Jpp7ROp+4HSwit7zreIWTdI0RQJDcF9Si0L/hr/A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53354: skbuff: skb_segment, Call zero copy functions before using skbuff frags Date: Wed, 17 Sep 2025 16:56:53 +0200 Message-ID: <2025091721-CVE-2023-53354-771f@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=5229; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=59/Bwk5f/WHmVYnFxXx1OB5WP2JMEaWmfO2UQlXR+as=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmnzohuENq7eA77h4Sz6yvn6Qk48j3a0d6dV/Kcy8agf g/rTBaZjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIxw2GBQ0qc/Ll/p+e1udb 8r7woHR1yqqpOgzzVJNbjE17BVoEQuRut57Tk4+J+1oBAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: skbuff: skb_segment, Call zero copy functions before using skbuff frags Commit bf5c25d60861 ("skbuff: in skb_segment, call zerocopy functions once per nskb") added the call to zero copy functions in skb_segment(). The change introduced a bug in skb_segment() because skb_orphan_frags() may possibly change the number of fragments or allocate new fragments altogether leaving nrfrags and frag to point to the old values. This can cause a panic with stacktrace like the one below. [ 193.894380] BUG: kernel NULL pointer dereference, address: 00000000000000bc [ 193.895273] CPU: 13 PID: 18164 Comm: vh-net-17428 Kdump: loaded Tainted: G O 5.15.123+ #26 [ 193.903919] RIP: 0010:skb_segment+0xb0e/0x12f0 [ 194.021892] Call Trace: [ 194.027422] [ 194.072861] tcp_gso_segment+0x107/0x540 [ 194.082031] inet_gso_segment+0x15c/0x3d0 [ 194.090783] skb_mac_gso_segment+0x9f/0x110 [ 194.095016] __skb_gso_segment+0xc1/0x190 [ 194.103131] netem_enqueue+0x290/0xb10 [sch_netem] [ 194.107071] dev_qdisc_enqueue+0x16/0x70 [ 194.110884] __dev_queue_xmit+0x63b/0xb30 [ 194.121670] bond_start_xmit+0x159/0x380 [bonding] [ 194.128506] dev_hard_start_xmit+0xc3/0x1e0 [ 194.131787] __dev_queue_xmit+0x8a0/0xb30 [ 194.138225] macvlan_start_xmit+0x4f/0x100 [macvlan] [ 194.141477] dev_hard_start_xmit+0xc3/0x1e0 [ 194.144622] sch_direct_xmit+0xe3/0x280 [ 194.147748] __dev_queue_xmit+0x54a/0xb30 [ 194.154131] tap_get_user+0x2a8/0x9c0 [tap] [ 194.157358] tap_sendmsg+0x52/0x8e0 [tap] [ 194.167049] handle_tx_zerocopy+0x14e/0x4c0 [vhost_net] [ 194.173631] handle_tx+0xcd/0xe0 [vhost_net] [ 194.176959] vhost_worker+0x76/0xb0 [vhost] [ 194.183667] kthread+0x118/0x140 [ 194.190358] ret_from_fork+0x1f/0x30 [ 194.193670] In this case calling skb_orphan_frags() updated nr_frags leaving nrfrags local variable in skb_segment() stale. This resulted in the code hitting i >= nrfrags prematurely and trying to move to next frag_skb using list_skb pointer, which was NULL, and caused kernel panic. Move the call to zero copy functions before using frags and nr_frags. The Linux kernel CVE team has assigned CVE-2023-53354 to this issue. Affected and fixed versions =========================== Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 4.19.295 with commit fcab3f661dbfd88e27ddbbe65368f3fa2d823175 Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 5.4.257 with commit d44403ec0676317b7f7edf2a035bb219fee3304e Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 5.10.195 with commit 8836c266201c29a5acb4f582227686f47b65ad61 Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 5.15.132 with commit d5790386595d06ea9decfd9ba5f1ea48cf09aa02 Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 6.1.53 with commit 04c3eee4e13f60bf6f9a366ad39f88a01a57166e Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 6.4.16 with commit f99006e840a4dbc8f5a34cecc6b5b26c73ef49bb Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 6.5.3 with commit 6c26ed3c6abe86ddab0510529000b970b05c9b40 Issue introduced in 4.16 with commit bf5c25d608613eaf4dcdba5a9cac5b2afe67d635 and fixed in 6.6 with commit 2ea35288c83b3d501a88bc17f2df8f176b5cc96f Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-53354 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/core/skbuff.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/fcab3f661dbfd88e27ddbbe65368f3fa2d823175 https://git.kernel.org/stable/c/d44403ec0676317b7f7edf2a035bb219fee3304e https://git.kernel.org/stable/c/8836c266201c29a5acb4f582227686f47b65ad61 https://git.kernel.org/stable/c/d5790386595d06ea9decfd9ba5f1ea48cf09aa02 https://git.kernel.org/stable/c/04c3eee4e13f60bf6f9a366ad39f88a01a57166e https://git.kernel.org/stable/c/f99006e840a4dbc8f5a34cecc6b5b26c73ef49bb https://git.kernel.org/stable/c/6c26ed3c6abe86ddab0510529000b970b05c9b40 https://git.kernel.org/stable/c/2ea35288c83b3d501a88bc17f2df8f176b5cc96f