From mboxrd@z Thu Jan 1 00:00:00 1970 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 3DCF01E201B for ; Wed, 4 Sep 2024 18:58:38 +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=1725476319; cv=none; b=IFL+jTuY4xEti+fIgI/J0zX4MKyux8Bxv0AKQ8nKB5UTc2OliRt78uLF1DGUQLlnEzMLhUHLG7/nti8MmOC2FJLLnbRu1qi5w1j6XoovFESnMZ7+fzTDJtKjgmtoq+zpBJHYwj2g8+3YAskMA3T5LIf0MXop0u6J1Y/HBvsfn+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725476319; c=relaxed/simple; bh=hUXnkD6apACxl/6uZD9FY3S/AiBsUF5tZwkzdt9sj9o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Nqhsbk786nt4BafIjKiQpHAcw57OvSbSwY7uBc9mL4bQnUFfQpkJLRV++d3IJ8zVObpffUt1s4cEBvYELcwL42hF/opFk4CwIvp/J8WLhpY4s4n8DakHZem9m7WtwELVwT7a1QNT8VWQwif57uIwFCighsQ4A59KXIUYmyguojo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jyrMvJgN; 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="jyrMvJgN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59D28C4CEC2; Wed, 4 Sep 2024 18:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725476318; bh=hUXnkD6apACxl/6uZD9FY3S/AiBsUF5tZwkzdt9sj9o=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jyrMvJgNT88cUOe8orr7VFP5ZWbqX1xMeBiAW+YSN4RZOwhJZy4spVYJbFyUo6Ce4 xaKar+ccEdhWut12tvYT7n34XD2F9DwmlJsyNsPEbgRPgmy1xmWylySocujXRs4YhP 11cOxz/Nre8tFYV9poG9katjX2VHQtcJCzZR9/vc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-44971: net: dsa: bcm_sf2: Fix a possible memory leak in bcm_sf2_mdio_register() Date: Wed, 4 Sep 2024 20:56:58 +0200 Message-ID: <2024090457-CVE-2024-44971-eb75@gregkh> X-Mailer: git-send-email 2.46.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=2843; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hUXnkD6apACxl/6uZD9FY3S/AiBsUF5tZwkzdt9sj9o=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk31lbee1aiu+9JduaF/IzTVTf55x7K6rs8g1k4JPJtR CKHm6BXRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyk24NhQbvHvaKQaUu9EuPm LNXlajL7tZjbkmF+9JpH6z6JZ+RURb+e/EK1e6f5G+3LAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net: dsa: bcm_sf2: Fix a possible memory leak in bcm_sf2_mdio_register() bcm_sf2_mdio_register() calls of_phy_find_device() and then phy_device_remove() in a loop to remove existing PHY devices. of_phy_find_device() eventually calls bus_find_device(), which calls get_device() on the returned struct device * to increment the refcount. The current implementation does not decrement the refcount, which causes memory leak. This commit adds the missing phy_device_free() call to decrement the refcount via put_device() to balance the refcount. The Linux kernel CVE team has assigned CVE-2024-44971 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 771089c2a485 and fixed in 5.10.224 with commit b7b8d9f5e679 Issue introduced in 5.10 with commit 771089c2a485 and fixed in 5.15.165 with commit c05516c07290 Issue introduced in 5.10 with commit 771089c2a485 and fixed in 6.1.105 with commit 7feef10768ea Issue introduced in 5.10 with commit 771089c2a485 and fixed in 6.6.46 with commit a7d2808d6757 Issue introduced in 5.10 with commit 771089c2a485 and fixed in 6.10.5 with commit f3d5efe18a11 Issue introduced in 5.10 with commit 771089c2a485 and fixed in 6.11-rc3 with commit e3862093ee93 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-2024-44971 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/dsa/bcm_sf2.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/b7b8d9f5e679af60c94251fd6728dde34be69a71 https://git.kernel.org/stable/c/c05516c072903f6fb9134b8e7e1ad4bffcdc4819 https://git.kernel.org/stable/c/7feef10768ea71d468d9bbc1e0d14c461876768c https://git.kernel.org/stable/c/a7d2808d67570e6acae45c2a96e0d59986888e4c https://git.kernel.org/stable/c/f3d5efe18a11f94150fee8b3fda9d62079af640a https://git.kernel.org/stable/c/e3862093ee93fcfbdadcb7957f5f8974fffa806a