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 7873D1EF0B1 for ; Mon, 21 Oct 2024 20:13:19 +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=1729541599; cv=none; b=JjWbonT7OXnzQvjwkdIHqMBANB7gRmCvRXdREmMAxp1D+t+WWzt3fhoaPdTufUKlZKzuXb+EbJIOYlUh+amReLDddVgTXtQNo4sXMkVYnpJRCkVpnFOMrpPhI8gtVk0r7T1qIJmiVtQKPQ04KpgcHBapJsj3TPg0/KxYI03EqpE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729541599; c=relaxed/simple; bh=ECgydhTqhk6QSusujfQvCTiInigyn1iQ+K+gbiFBG0E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ypk24hgEyD3M0A2Ey98LeNtSBgFXpCF3wNqHTsTceFypiSrF8wCtpjsVobwliJag8+pryzpkp3WzghMeNMEHIlL8tT/1169I264gX4+GE22/B4RQZPtqqVywJuXmRhbcwUoiDJl7XvvGIDVgtgTQUtoqGuHKWjVbeGzReMnj/l4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mk4dzTOD; 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="mk4dzTOD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFF30C4CEC3; Mon, 21 Oct 2024 20:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729541599; bh=ECgydhTqhk6QSusujfQvCTiInigyn1iQ+K+gbiFBG0E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=mk4dzTOD3tpIc52Cc43gyaEki3R6waIXzjeFa8Hl89jHrt4/ghW7eNo1btv2Pfc7E qwztuqti8MgsPPVw/s7BhPmlvC+pIq5purTZz0e9CtYmm0Unal9GMHFVr2Dn2dFdjK 9j71KE2qfmRInBpE2AKH7EOJI2mTdLnieOjrLQ6c= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49016: net: mdiobus: fix unbalanced node reference count Date: Mon, 21 Oct 2024 22:06:48 +0200 Message-ID: <2024102153-CVE-2022-49016-c7bb@gregkh> X-Mailer: git-send-email 2.47.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=2583; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ECgydhTqhk6QSusujfQvCTiInigyn1iQ+K+gbiFBG0E=; b=owGbwMvMwCRo6H6F97bub03G02pJDOliWxR3yWc8Xyema2D58V1j8KzJH/nUyuzWRq2coDkz9 dv7767/O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi7xYyzDPYdTU+fOmkJ+Er NpzJdbpr7+O/o4lhfumvD906i9ZJuMsfrLo6/8vTI9tPSgIA 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: mdiobus: fix unbalanced node reference count I got the following report while doing device(mscc-miim) load test with CONFIG_OF_UNITTEST and CONFIG_OF_DYNAMIC enabled: OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /spi/soc@0/mdio@7107009c/ethernet-phy@0 If the 'fwnode' is not an acpi node, the refcount is get in fwnode_mdiobus_phy_device_register(), but it has never been put when the device is freed in the normal path. So call fwnode_handle_put() in phy_device_release() to avoid leak. If it's an acpi node, it has never been get, but it's put in the error path, so call fwnode_handle_get() before phy_device_register() to keep get/put operation balanced. The Linux kernel CVE team has assigned CVE-2022-49016 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit bc1bee3b87ee and fixed in 5.15.82 with commit 543d917f691a Issue introduced in 5.14 with commit bc1bee3b87ee and fixed in 6.0.12 with commit 2708b3574404 Issue introduced in 5.14 with commit bc1bee3b87ee and fixed in 6.1 with commit cdde1560118f 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-49016 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/mdio/fwnode_mdio.c drivers/net/phy/phy_device.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/543d917f691ab06885ee779c862065899eaa4251 https://git.kernel.org/stable/c/2708b357440427d6a9fee667eb7b8307f4625adc https://git.kernel.org/stable/c/cdde1560118f82498fc9e9a7c1ef7f0ef7755891