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 660391391 for ; Tue, 9 Dec 2025 00:03:59 +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=1765238639; cv=none; b=FrU2soO1ncDODCGeGvUNq5hde4gYaAeDFdYyFUL3GSESkUMElaEmXOZP03Qotk2Gq9Iu2o4tDu9CxP6sLdAt7KaHtE3+PmoUYvmi1ZXwomUYfYY8e1TXS/gK0bBkn2krC/0mT3mpBvFpPZewPtPb6gyKJ3dFMC6rYoiVYgKkfIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238639; c=relaxed/simple; bh=1tOggbCbsBFSsCBuSNatdzvA5t43PXf2rMq4uKYi6Ek=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gUeUZWp5GsxofAf5i8e3l5gg/Y/PqNQY/h6KtER7IESG9MvvO5ctQS3CDJm2DqFkY3V4SMqiQfc4OMhzrW2PoDjMgGTfYFD6LG9d9pyp4qq798hi/YTVCnbBqqKE4ufUcI9j/zACaLS90ZYVbKYvjUmSCoe0G29IFiAUMaW5q94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Df1VUvup; 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="Df1VUvup" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C13AAC4CEF1; Tue, 9 Dec 2025 00:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765238639; bh=1tOggbCbsBFSsCBuSNatdzvA5t43PXf2rMq4uKYi6Ek=; h=From:To:Cc:Subject:Date:Reply-To:From; b=Df1VUvupKmcv4096i9kVgUS/lTDgXVx8FL5kPs2oQ2tsRmKZ7LIjNypoCI9j3mb3g YK0WAMCua2YKEFQAmAEKA5VZ7cGrsHqmOVDUT6b1SuBEW2TEEJdiXF9JbKR2XQf36a TPloMYybW2h0V9umD20Xjp6QUEkPQSBY39gMFuJY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53798: ethtool: Fix uninitialized number of lanes Date: Tue, 9 Dec 2025 09:02:19 +0900 Message-ID: <2025120942-CVE-2023-53798-7845@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6934; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=QEuabffsIvfudj4E3yVj2Xq0Tr+NEVzZB5qCfE9+6b4=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmac8EzMR/rY2fe6Hqhff8A4wq0d3RAR+/nto+zSn2O Y/kZdeKjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIpq0M8xN6bTJmrjOob4m1 k1S5Pm2pk90ZU4YFa9Umbp5VKXn7I3PRqTfcz/vLLW0WAgA= 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: ethtool: Fix uninitialized number of lanes It is not possible to set the number of lanes when setting link modes using the legacy IOCTL ethtool interface. Since 'struct ethtool_link_ksettings' is not initialized in this path, drivers receive an uninitialized number of lanes in 'struct ethtool_link_ksettings::lanes'. When this information is later queried from drivers, it results in the ethtool code making decisions based on uninitialized memory, leading to the following KMSAN splat [1]. In practice, this most likely only happens with the tun driver that simply returns whatever it got in the set operation. As far as I can tell, this uninitialized memory is not leaked to user space thanks to the 'ethtool_ops->cap_link_lanes_supported' check in linkmodes_prepare_data(). Fix by initializing the structure in the IOCTL path. Did not find any more call sites that pass an uninitialized structure when calling 'ethtool_ops::set_link_ksettings()'. [1] BUG: KMSAN: uninit-value in ethnl_update_linkmodes net/ethtool/linkmodes.c:273 [inline] BUG: KMSAN: uninit-value in ethnl_set_linkmodes+0x190b/0x19d0 net/ethtool/linkmodes.c:333 ethnl_update_linkmodes net/ethtool/linkmodes.c:273 [inline] ethnl_set_linkmodes+0x190b/0x19d0 net/ethtool/linkmodes.c:333 ethnl_default_set_doit+0x88d/0xde0 net/ethtool/netlink.c:640 genl_family_rcv_msg_doit net/netlink/genetlink.c:968 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x141a/0x14c0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x3f8/0x750 net/netlink/af_netlink.c:2577 genl_rcv+0x40/0x60 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0xf41/0x1270 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x127d/0x1430 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0xa24/0xe40 net/socket.c:2501 ___sys_sendmsg+0x2a1/0x3f0 net/socket.c:2555 __sys_sendmsg net/socket.c:2584 [inline] __do_sys_sendmsg net/socket.c:2593 [inline] __se_sys_sendmsg net/socket.c:2591 [inline] __x64_sys_sendmsg+0x36b/0x540 net/socket.c:2591 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Uninit was stored to memory at: tun_get_link_ksettings+0x37/0x60 drivers/net/tun.c:3544 __ethtool_get_link_ksettings+0x17b/0x260 net/ethtool/ioctl.c:441 ethnl_set_linkmodes+0xee/0x19d0 net/ethtool/linkmodes.c:327 ethnl_default_set_doit+0x88d/0xde0 net/ethtool/netlink.c:640 genl_family_rcv_msg_doit net/netlink/genetlink.c:968 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x141a/0x14c0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x3f8/0x750 net/netlink/af_netlink.c:2577 genl_rcv+0x40/0x60 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0xf41/0x1270 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x127d/0x1430 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0xa24/0xe40 net/socket.c:2501 ___sys_sendmsg+0x2a1/0x3f0 net/socket.c:2555 __sys_sendmsg net/socket.c:2584 [inline] __do_sys_sendmsg net/socket.c:2593 [inline] __se_sys_sendmsg net/socket.c:2591 [inline] __x64_sys_sendmsg+0x36b/0x540 net/socket.c:2591 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Uninit was stored to memory at: tun_set_link_ksettings+0x37/0x60 drivers/net/tun.c:3553 ethtool_set_link_ksettings+0x600/0x690 net/ethtool/ioctl.c:609 __dev_ethtool net/ethtool/ioctl.c:3024 [inline] dev_ethtool+0x1db9/0x2a70 net/ethtool/ioctl.c:3078 dev_ioctl+0xb07/0x1270 net/core/dev_ioctl.c:524 sock_do_ioctl+0x295/0x540 net/socket.c:1213 sock_ioctl+0x729/0xd90 net/socket.c:1316 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0x222/0x400 fs/ioctl.c:856 __x64_sys_ioctl+0x96/0xe0 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Local variable link_ksettings created at: ethtool_set_link_ksettings+0x54/0x690 net/ethtool/ioctl.c:577 __dev_ethtool net/ethtool/ioctl.c:3024 [inline] dev_ethtool+0x1db9/0x2a70 net/ethtool/ioctl.c:3078 The Linux kernel CVE team has assigned CVE-2023-53798 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit 012ce4dd3102a0f4d80167de343e9d44b257c1b8 and fixed in 5.15.112 with commit da81af0ef8092ecacd87fac3229c29e2e0ce39fd Issue introduced in 5.12 with commit 012ce4dd3102a0f4d80167de343e9d44b257c1b8 and fixed in 6.1.29 with commit 942a2a0184f7bb1c1ae4bbc556559c86c054b0d2 Issue introduced in 5.12 with commit 012ce4dd3102a0f4d80167de343e9d44b257c1b8 and fixed in 6.2.16 with commit 6456d80045d6de47734b1a3879c91f72af186529 Issue introduced in 5.12 with commit 012ce4dd3102a0f4d80167de343e9d44b257c1b8 and fixed in 6.3.3 with commit 72808c4ab5fd01bf1214195005e15b434bf55cef Issue introduced in 5.12 with commit 012ce4dd3102a0f4d80167de343e9d44b257c1b8 and fixed in 6.4 with commit 9ad685dbfe7e856bbf17a7177b64676d324d6ed7 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-53798 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/ethtool/ioctl.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/da81af0ef8092ecacd87fac3229c29e2e0ce39fd https://git.kernel.org/stable/c/942a2a0184f7bb1c1ae4bbc556559c86c054b0d2 https://git.kernel.org/stable/c/6456d80045d6de47734b1a3879c91f72af186529 https://git.kernel.org/stable/c/72808c4ab5fd01bf1214195005e15b434bf55cef https://git.kernel.org/stable/c/9ad685dbfe7e856bbf17a7177b64676d324d6ed7