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 D6C8610FD for ; Fri, 25 Jul 2025 14:05:54 +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=1753452354; cv=none; b=OEIRPnk7eGk/R9exjUsoFAG2AydFEevofIZEXMh7+vW3dXRVjmewUFrrNHFbKqx8BbTZsNZuEnhL8e/5Cx3E3quFqV5qrT4l7jqS2mxvVi1RFyLgE1iGje0Roe5gAo8p2cIweb/unqZi9ulAixYXus9PKCpybmiFpaUYsfUik2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753452354; c=relaxed/simple; bh=KyKUEKuZtk22aig/lS58U3wSkkc48yxghze+Qu8f8QM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UIs1m7PjBBhGG60aB+yjiM9aCxYQ2n9MdDc7C2vIq/1CzT8+lMMZ05LkBg/k+vYAz+BRI/Yl+9cmbBTMDhlEjdWppe6iEsYDTrVvq5eg/LH/0TYXvAcc/XjVCKe950Hueh7CmRANHnvXUJaJOIQ+2C5awnZepmVwrH5RZzBvOKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XpiitjY/; 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="XpiitjY/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12760C4CEE7; Fri, 25 Jul 2025 14:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753452354; bh=KyKUEKuZtk22aig/lS58U3wSkkc48yxghze+Qu8f8QM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XpiitjY/eY+xNGOTct73JhYcNLhzdir1BgQtKz5gTu2j41poQqeF53b0g/O3sp949 kfkRNEpdiA71qQHxXpUYbPZBPUQzpBIQnuX1YHIjH+pLXM346mTukfI7S7OpUqry53 BLJ6//7AfQORn+i1ciMbNs/UeNIuMq1c0De1rsgk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38417: ice: fix eswitch code memory leak in reset scenario Date: Fri, 25 Jul 2025 16:05:46 +0200 Message-ID: <2025072546-CVE-2025-38417-12d4@gregkh> X-Mailer: git-send-email 2.50.1 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=3434; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=tDOQA4t3bIeF5joBLhF2u4VtSEaGhbKO+AGX5BvZvyw=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnN/VYfNvD+n+JzIE/mkzXnK2/+CMs/yVkzOy94xUX5n ul6dfB2RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyk8CLDglUMc5+0SHWv+XRb 6aFgzKRT1w9kBzHMFfhlm5y/mWXhk8VXFGI2qBZ84RblBQA= 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: ice: fix eswitch code memory leak in reset scenario Add simple eswitch mode checker in attaching VF procedure and allocate required port representor memory structures only in switchdev mode. The reset flows triggers VF (if present) detach/attach procedure. It might involve VF port representor(s) re-creation if the device is configured is switchdev mode (not legacy one). The memory was blindly allocated in current implementation, regardless of the mode and not freed if in legacy mode. Kmemeleak trace: unreferenced object (percpu) 0x7e3bce5b888458 (size 40): comm "bash", pid 1784, jiffies 4295743894 hex dump (first 32 bytes on cpu 45): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc 0): pcpu_alloc_noprof+0x4c4/0x7c0 ice_repr_create+0x66/0x130 [ice] ice_repr_create_vf+0x22/0x70 [ice] ice_eswitch_attach_vf+0x1b/0xa0 [ice] ice_reset_all_vfs+0x1dd/0x2f0 [ice] ice_pci_err_resume+0x3b/0xb0 [ice] pci_reset_function+0x8f/0x120 reset_store+0x56/0xa0 kernfs_fop_write_iter+0x120/0x1b0 vfs_write+0x31c/0x430 ksys_write+0x61/0xd0 do_syscall_64+0x5b/0x180 entry_SYSCALL_64_after_hwframe+0x76/0x7e Testing hints (ethX is PF netdev): - create at least one VF echo 1 > /sys/class/net/ethX/device/sriov_numvfs - trigger the reset echo 1 > /sys/class/net/ethX/device/reset The Linux kernel CVE team has assigned CVE-2025-38417 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit 415db8399d06a45ebd7b7d26b951f831a4b01801 and fixed in 6.12.35 with commit d6715193de439b79f1d6a4c03593c7529239b545 Issue introduced in 6.12 with commit 415db8399d06a45ebd7b7d26b951f831a4b01801 and fixed in 6.15.4 with commit e97a7a051b55f55f276c1568491d0ed7f890ee94 Issue introduced in 6.12 with commit 415db8399d06a45ebd7b7d26b951f831a4b01801 and fixed in 6.16-rc3 with commit 48c8b214974dc55283bd5f12e3a483b27c403bbc 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-2025-38417 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/ice/ice_eswitch.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/d6715193de439b79f1d6a4c03593c7529239b545 https://git.kernel.org/stable/c/e97a7a051b55f55f276c1568491d0ed7f890ee94 https://git.kernel.org/stable/c/48c8b214974dc55283bd5f12e3a483b27c403bbc