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 8514617F371 for ; Wed, 10 Apr 2024 18:58:30 +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=1712775511; cv=none; b=bf0WrkZGAchAu7E8+MftmAmN+VMpfV42CNdoCoks7yaxyaA2nt+XcKfV2m2BJxMK09lntE4etNWB6+DEcmtO8f3d1ysLKeqbPqppzmTU05PHuiooKl0LBV+Jso/vK6xXXBCzDGFDVUm/oNsdyvuw5/pZF6XyNQjXrYmFQ5XeT/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712775511; c=relaxed/simple; bh=NR4SGiSs3gssOg8v4FgikuvrenckNHB41FO7PH+tt40=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N3Amqwpy85GGuQOwMZ/zPnYOHLr8JLP6Y6yl+82fO2ra9oMBOlGt1jc0s2eA/YbVHlkIoAmyLO92xaIL7Yx3DZQyCnlcmGI+4UfcRcFyeAl/rZ+0tMNdlZ0oo8X7YyNsgPzrdvtMZQBDz8WaJK6xNDUqCOiRH0/IVaExE4lxCJQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Y0g2dF1u; 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="Y0g2dF1u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE3BDC43390; Wed, 10 Apr 2024 18:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712775510; bh=NR4SGiSs3gssOg8v4FgikuvrenckNHB41FO7PH+tt40=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Y0g2dF1uIGjXvYhfT01EdbAUb1QgtdoLbdDrUy9kSIhs7WalxYowRoDZ6bQ4n6Wf1 dEsBbR8MFCmQdAAKIbm2fpT9aeFSNPRp09317rH+EeyVEjzpHdJ4Rn8s4Afvac6beb D9XQbCp3zMK34k72tvbuJbGjZ09226vYHzNUv4uk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47205: clk: sunxi-ng: Unregister clocks/resets when unbinding Date: Wed, 10 Apr 2024 20:57:54 +0200 Message-ID: <2024041038-CVE-2021-47205-3f43@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=3146; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=NR4SGiSs3gssOg8v4FgikuvrenckNHB41FO7PH+tt40=; b=owGbwMvMwCRo6H6F97bub03G02pJDGliD5WuNV/LnPPCoG6jb2LrjKIjlsr/NPd7x81TZNAuz tqqwOjaEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABMJUmGYK19SEZ7BfPWl1Jlt ZoLffBlTlyRoM8z3d457q7LptIbKv4Xzr4ux1u716ukFAA== 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: clk: sunxi-ng: Unregister clocks/resets when unbinding Currently, unbinding a CCU driver unmaps the device's MMIO region, while leaving its clocks/resets and their providers registered. This can cause a page fault later when some clock operation tries to perform MMIO. Fix this by separating the CCU initialization from the memory allocation, and then using a devres callback to unregister the clocks and resets. This also fixes a memory leak of the `struct ccu_reset`, and uses the correct owner (the specific platform driver) for the clocks and resets. Early OF clock providers are never unregistered, and limited error handling is possible, so they are mostly unchanged. The error reporting is made more consistent by moving the message inside of_sunxi_ccu_probe. The Linux kernel CVE team has assigned CVE-2021-47205 to this issue. Affected and fixed versions =========================== Fixed in 5.15.5 with commit b5dd513daa70 Fixed in 5.16 with commit 9bec2b9c6134 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-2021-47205 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/clk/sunxi-ng/ccu-sun4i-a10.c drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c drivers/clk/sunxi-ng/ccu-sun50i-a100.c drivers/clk/sunxi-ng/ccu-sun50i-a64.c drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c drivers/clk/sunxi-ng/ccu-sun50i-h6.c drivers/clk/sunxi-ng/ccu-sun50i-h616.c drivers/clk/sunxi-ng/ccu-sun5i.c drivers/clk/sunxi-ng/ccu-sun6i-a31.c drivers/clk/sunxi-ng/ccu-sun8i-a23.c drivers/clk/sunxi-ng/ccu-sun8i-a33.c drivers/clk/sunxi-ng/ccu-sun8i-a83t.c drivers/clk/sunxi-ng/ccu-sun8i-de2.c drivers/clk/sunxi-ng/ccu-sun8i-h3.c drivers/clk/sunxi-ng/ccu-sun8i-r.c drivers/clk/sunxi-ng/ccu-sun8i-r40.c drivers/clk/sunxi-ng/ccu-sun8i-v3s.c drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c drivers/clk/sunxi-ng/ccu-sun9i-a80.c drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c drivers/clk/sunxi-ng/ccu_common.c drivers/clk/sunxi-ng/ccu_common.h 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/b5dd513daa70ee8f6d281a20bd28485ee9bb7db2 https://git.kernel.org/stable/c/9bec2b9c6134052994115d2d3374e96f2ccb9b9d