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 8850426C386 for ; Fri, 9 May 2025 06:44:16 +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=1746773056; cv=none; b=AE+9DU5XgwlPLSmfBIAfUNlXFpe1csFj4ocyVPwr5RbVobGOsB5iB2S0rlCJR8p6DtfCzZWHImopBQvwDFWYD/NacCVdVf9X6/+ryReCjbIrbaQOn+Df9Y9g4aUx7d6lhrdw9IrZLDPmRtEWjwR+OiOsD4NUQ7PqBlAWhKOtuZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773056; c=relaxed/simple; bh=QMQ93ZO2ENFtxmAszwVG+YloEHqiDXEY+gASSXGgf1g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qQrgH+qV4FZTcFMkt8SrK8EdqyOGfoDar7tebcaJbjnPy8Vq/b3v/NIfDy5kT6BeLoEfzjPEzZMrFBKc4MeEsC9NEa0s/8q2xrFYs8Ic4fuUq9yBZbaeXM1nnZLhZ6GE4Ub8tvrgcjnnSHdpCNPqwMlgSLNJW121/owJsXUHPGQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MJoo7rpe; 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="MJoo7rpe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E101CC4CEE4; Fri, 9 May 2025 06:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746773056; bh=QMQ93ZO2ENFtxmAszwVG+YloEHqiDXEY+gASSXGgf1g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=MJoo7rpejOFJYisf1TKhkozoSozGuViRGU0TahJ8BXi2134b8l3G0jA7TMpA9de32 rP+21Ue6CxxnMeXkdIWfKFiXQI2PtNqzvWAOVNzfuXY7hUK1iSxUy5hmTUA3QzH3EX WM+RAuJHbqF0Cjllm8IMeu7HVpyJNdaGCnCiWlmU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37874: net: ngbe: fix memory leak in ngbe_probe() error path Date: Fri, 9 May 2025 08:44:08 +0200 Message-ID: <2025050900-CVE-2025-37874-81e8@gregkh> X-Mailer: git-send-email 2.49.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=2695; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vXsB3gGO20W3aNF3yevPASTra8fn0TbK82K9CLlXZJU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmySwyuHjKIZjl6T7KObXnExNS5rB8dJt9cfizvCPfZp 0+ulkjkdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEdiQzzM94W2GpazrrlVmV T6nzI94qzZlsWxkWbDrDJ7DuQ+U22W+6PE/vv/Te9PlIHQA= 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: net: ngbe: fix memory leak in ngbe_probe() error path When ngbe_sw_init() is called, memory is allocated for wx->rss_key in wx_init_rss_key(). However, in ngbe_probe() function, the subsequent error paths after ngbe_sw_init() don't free the rss_key. Fix that by freeing it in error path along with wx->mac_table. Also change the label to which execution jumps when ngbe_sw_init() fails, because otherwise, it could lead to a double free for rss_key, when the mac_table allocation fails in wx_sw_init(). The Linux kernel CVE team has assigned CVE-2025-37874 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit 02338c484ab6250b81f0266ffb40d53c3efe0f47 and fixed in 6.6.88 with commit 7c2b66a31c7a4866400f7e6fb43cb32021bfca01 Issue introduced in 6.2 with commit 02338c484ab6250b81f0266ffb40d53c3efe0f47 and fixed in 6.12.25 with commit 8335a3feb9d0d97e5e8f76d38b6bb8573d5b4a29 Issue introduced in 6.2 with commit 02338c484ab6250b81f0266ffb40d53c3efe0f47 and fixed in 6.14.4 with commit 397487338eff1891c4654ce7deaafbf72a1688b2 Issue introduced in 6.2 with commit 02338c484ab6250b81f0266ffb40d53c3efe0f47 and fixed in 6.15-rc3 with commit 88fa80021b77732bc98f73fb69d69c7cc37b9f0d 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-37874 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/wangxun/ngbe/ngbe_main.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/7c2b66a31c7a4866400f7e6fb43cb32021bfca01 https://git.kernel.org/stable/c/8335a3feb9d0d97e5e8f76d38b6bb8573d5b4a29 https://git.kernel.org/stable/c/397487338eff1891c4654ce7deaafbf72a1688b2 https://git.kernel.org/stable/c/88fa80021b77732bc98f73fb69d69c7cc37b9f0d