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 B264021B9F5 for ; Tue, 9 Dec 2025 01:31:53 +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=1765243913; cv=none; b=p8gZp8QZ7FfsGOPceUqqFNZDwXGtBHfpxLDI9EC+do941KkMPuGOI8PtOXYzSHP2vwu+J7MyDPCzpnSgU4zwx9r39hmvtGr86CJv6+mFWMpPSk3zKj7eXIqqB1Xy9nQZOF70oAdYR5HXjPSC3zW5VPFLHkAYumjZDxDCkIlLf88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765243913; c=relaxed/simple; bh=DFJk74WC1hJKwNdZA14kgutNN1nA9zDOB1ocnCV1XIY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rpJGi0/YcHFFQhgN2PLSS72SMktxpz6oFpBsrjOKPJVA2uVbqOmx2NDB7br7cbVnMIImx4APPDZfXbZp2sCbuIr0Y7EqursFI6c/jzXaDSSO8R9cBLzeY0/G+BayI2I6jAeoSlAJWVgzF9H3Yg84UHs1Z3lr6m3j3IkczGkqj1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=usRFda2p; 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="usRFda2p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05E15C4CEF1; Tue, 9 Dec 2025 01:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765243913; bh=DFJk74WC1hJKwNdZA14kgutNN1nA9zDOB1ocnCV1XIY=; h=From:To:Cc:Subject:Date:Reply-To:From; b=usRFda2piReFzUaSSFp8jGaEqg0KuSdxckTfIdwqh/4P2+MHsMpkRT+lGrQFj0ADa JlPG+ydVxB0aCavPENgarmQADrh3LVPKhv+r9b82485aTMBbVSo45mFFjObJ8VRtyL YPZ/ocVRpYEz+aBmOu07DWEuJn2UIQCoNcbMsEz8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50679: i40e: Fix DMA mappings leak Date: Tue, 9 Dec 2025 10:31:04 +0900 Message-ID: <2025120949-CVE-2022-50679-b2b8@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=4822; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GMm/t0+qxT81rGvmLSMv7sLMs7CqNRsH6s9kKKvg6v8=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnm1SerXrY2fd9fwcfOen6S1s/9Vu93ZLnUbnq6Zu3rk 9ruq46wd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEIuMY5oe49JwWck+6zc8k FnBVruif453lpxkWTFl+NrnO+VS9XdS0nJDA1PpPd6PMAQ== 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: i40e: Fix DMA mappings leak During reallocation of RX buffers, new DMA mappings are created for those buffers. steps for reproduction: while : do for ((i=0; i<=8160; i=i+32)) do ethtool -G enp130s0f0 rx $i tx $i sleep 0.5 ethtool -g enp130s0f0 done done This resulted in crash: i40e 0000:01:00.1: Unable to allocate memory for the Rx descriptor ring, size=65536 Driver BUG WARNING: CPU: 0 PID: 4300 at net/core/xdp.c:141 xdp_rxq_info_unreg+0x43/0x50 Call Trace: i40e_free_rx_resources+0x70/0x80 [i40e] i40e_set_ringparam+0x27c/0x800 [i40e] ethnl_set_rings+0x1b2/0x290 genl_family_rcv_msg_doit.isra.15+0x10f/0x150 genl_family_rcv_msg+0xb3/0x160 ? rings_fill_reply+0x1a0/0x1a0 genl_rcv_msg+0x47/0x90 ? genl_family_rcv_msg+0x160/0x160 netlink_rcv_skb+0x4c/0x120 genl_rcv+0x24/0x40 netlink_unicast+0x196/0x230 netlink_sendmsg+0x204/0x3d0 sock_sendmsg+0x4c/0x50 __sys_sendto+0xee/0x160 ? handle_mm_fault+0xbe/0x1e0 ? syscall_trace_enter+0x1d3/0x2c0 __x64_sys_sendto+0x24/0x30 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x65/0xca RIP: 0033:0x7f5eac8b035b Missing register, driver bug WARNING: CPU: 0 PID: 4300 at net/core/xdp.c:119 xdp_rxq_info_unreg_mem_model+0x69/0x140 Call Trace: xdp_rxq_info_unreg+0x1e/0x50 i40e_free_rx_resources+0x70/0x80 [i40e] i40e_set_ringparam+0x27c/0x800 [i40e] ethnl_set_rings+0x1b2/0x290 genl_family_rcv_msg_doit.isra.15+0x10f/0x150 genl_family_rcv_msg+0xb3/0x160 ? rings_fill_reply+0x1a0/0x1a0 genl_rcv_msg+0x47/0x90 ? genl_family_rcv_msg+0x160/0x160 netlink_rcv_skb+0x4c/0x120 genl_rcv+0x24/0x40 netlink_unicast+0x196/0x230 netlink_sendmsg+0x204/0x3d0 sock_sendmsg+0x4c/0x50 __sys_sendto+0xee/0x160 ? handle_mm_fault+0xbe/0x1e0 ? syscall_trace_enter+0x1d3/0x2c0 __x64_sys_sendto+0x24/0x30 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x65/0xca RIP: 0033:0x7f5eac8b035b This was caused because of new buffers with different RX ring count should substitute older ones, but those buffers were freed in i40e_configure_rx_ring and reallocated again with i40e_alloc_rx_bi, thus kfree on rx_bi caused leak of already mapped DMA. Fix this by reallocating ZC with rx_bi_zc struct when BPF program loads. Additionally reallocate back to rx_bi when BPF program unloads. If BPF program is loaded/unloaded and XSK pools are created, reallocate RX queues accordingly in XSP_SETUP_XSK_POOL handler. The Linux kernel CVE team has assigned CVE-2022-50679 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit be1222b585fdc410b8c1dbcc57dd03a00f04eff5 and fixed in 5.10.152 with commit ed5baf3d0a33caaca4cd4073ebb0854cc77a616d Issue introduced in 5.8 with commit be1222b585fdc410b8c1dbcc57dd03a00f04eff5 and fixed in 5.15.76 with commit 94a171c982b8a8137a00721c1e62bc2713435bca Issue introduced in 5.8 with commit be1222b585fdc410b8c1dbcc57dd03a00f04eff5 and fixed in 6.0.6 with commit 5f499596dfa3db9b3172645b6de9e1096a669c95 Issue introduced in 5.8 with commit be1222b585fdc410b8c1dbcc57dd03a00f04eff5 and fixed in 6.1 with commit aae425efdfd1b1d8452260a3cb49344ebf20b1f5 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-2022-50679 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: drivers/net/ethernet/intel/i40e/i40e_ethtool.c drivers/net/ethernet/intel/i40e/i40e_main.c drivers/net/ethernet/intel/i40e/i40e_txrx.c drivers/net/ethernet/intel/i40e/i40e_txrx.h drivers/net/ethernet/intel/i40e/i40e_xsk.c drivers/net/ethernet/intel/i40e/i40e_xsk.h 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/ed5baf3d0a33caaca4cd4073ebb0854cc77a616d https://git.kernel.org/stable/c/94a171c982b8a8137a00721c1e62bc2713435bca https://git.kernel.org/stable/c/5f499596dfa3db9b3172645b6de9e1096a669c95 https://git.kernel.org/stable/c/aae425efdfd1b1d8452260a3cb49344ebf20b1f5