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 D988A5B66E for ; Wed, 6 Mar 2024 06:45:52 +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=1709707553; cv=none; b=i8YheGwmvKJA/vUQHf0XCz2/QVQiIpJyzwuL7ygaU/wqy4sidzUsR50R4QGgu9Ubx1dNXZzAYx9sfgvRlDeL+nVmFwKQjkn2BvOgKnRy12vuDAKklSdaccHKYVwcQrFOxhr5HttUzbRgtSTWUwpHIxCyFKQdlbHWnrMrfOG7FoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709707553; c=relaxed/simple; bh=1lGUnX2SPE1awzxI+JmvcyDUIHIRIzdwpb5cu6k8DgE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ly9xDYd6wqN4JIUxeRaCNdvD019+9vkGBe0ym8OPYtKdQOROaFnSH0k+dl1ZB7MJUoBUFbQYy+dq4ehRHGv/97Z/U6Y+Fo2XNzwPnaeY9crXAQ/3pT4rLgd1a7sryXszl+CcLV/gcV6zgAYrIIx/1fTY94eUgfgVssQ7MQvbwMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J4Gjrp4R; 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="J4Gjrp4R" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 111FDC433C7; Wed, 6 Mar 2024 06:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709707552; bh=1lGUnX2SPE1awzxI+JmvcyDUIHIRIzdwpb5cu6k8DgE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=J4Gjrp4RM/WakQnJ7mSXnBHaYoNUpNmb/ZuE/cAQZ+zPxgv+baIEZRoRAGH8bwmX9 sTHE64lzzLbVI1sO9tKPM2ZaSvHYLzOoZaNft+e0Oid0tOg9PxGodTSQlAXzifQtTl i5i6lgo2/YdV6eDSXW3+QJNuXvxTY7Xm8EU4uHQU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52584: spmi: mediatek: Fix UAF on device remove Date: Wed, 6 Mar 2024 06:45:42 +0000 Message-ID: <2024030643-CVE-2023-52584-fb9a@gregkh> X-Mailer: git-send-email 2.44.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=2327; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=1lGUnX2SPE1awzxI+JmvcyDUIHIRIzdwpb5cu6k8DgE=; b=owGbwMvMwCRo6H6F97bub03G02pJDKkvBMV/Pb0SordQy9X+9Kywwjg5t57lLopmCkqHBNxkZ H/Peza1I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACainM4w310y/vSy3TVWK1Id b7k32mvkFtZwMCy4vvHjuwXTw57fmPykImzijfANF3T2AwA= 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: spmi: mediatek: Fix UAF on device remove The pmif driver data that contains the clocks is allocated along with spmi_controller. On device remove, spmi_controller will be freed first, and then devres , including the clocks, will be cleanup. This leads to UAF because putting the clocks will access the clocks in the pmif driver data, which is already freed along with spmi_controller. This can be reproduced by enabling DEBUG_TEST_DRIVER_REMOVE and building the kernel with KASAN. Fix the UAF issue by using unmanaged clk_bulk_get() and putting the clocks before freeing spmi_controller. The Linux kernel CVE team has assigned CVE-2023-52584 to this issue. Affected and fixed versions =========================== Fixed in 6.1.77 with commit 521f28eedd6b Fixed in 6.6.16 with commit f8dcafcb5463 Fixed in 6.7.4 with commit 9a3881b1f07d Fixed in 6.8-rc1 with commit e821d50ab5b9 Please see https://www.kernel.org or 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-2023-52584 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/spmi/spmi-mtk-pmif.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/521f28eedd6b14228c46e3b81e3bf9b90c2818d8 https://git.kernel.org/stable/c/f8dcafcb54632536684336161da8bdd52120f95e https://git.kernel.org/stable/c/9a3881b1f07db1bb55cb0108e6f05cfd027eaf2e https://git.kernel.org/stable/c/e821d50ab5b956ed0effa49faaf29912fd4106d9