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 3CAFD14372D for ; Tue, 21 May 2024 15:06:37 +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=1716303997; cv=none; b=WJWn82b8TMQiuJazYpU/xdMMPjGJFKseK1tSAl0/2QCsH20arsEbqd2zwCP9BKlvAAZKqgGu2lwzqiBr5IIABC4vt9FnNIXPyiLOyLtDHyICpGo8fKwOW4YSScjbQz/MC5mbDpjHf3Xiwgwt3jm+StgQBiqarKBuVNU2h4v5Hzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716303997; c=relaxed/simple; bh=jZc/MIAF/jDIvYGpU+jN9vbQAqj5c02EG/ASWKcQq+E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DQ0hQQ9bnRwf0D3y3pKMcvbPb/r7v4wt1TnAp2st8IEngJMvjMc75KprkNHY1COuQQjawM+cHJfNDUX4cWkWZ45W629y08KhoKpvT6N5xthMOjyfjW+3Kf6pDzCYXYvdyczi+ZYj3ssY4VDrHNpKAGFPkkpdZi5AI8k3hlXC/Hg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=E22wvxAR; 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="E22wvxAR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDC12C2BD11; Tue, 21 May 2024 15:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716303997; bh=jZc/MIAF/jDIvYGpU+jN9vbQAqj5c02EG/ASWKcQq+E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=E22wvxARmF7O5sKQbV3iDoFc4s9kaJvx5g5P+AKJ686p8Wf2AMGC6E6lrx6pI0T/0 Dv62GXO823P0U2wtP/AT5WISLEh5Xb+EnCQQgkNjDnyyVeu+n5LIMXV5UCylJLyG6S Z/SDergA/pVuxMIKAcro2MYl7HP/l1azhoIF0m3A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47413: usb: chipidea: ci_hdrc_imx: Also search for 'phys' phandle Date: Tue, 21 May 2024 17:04:30 +0200 Message-ID: <2024052153-CVE-2021-47413-5ff4@gregkh> X-Mailer: git-send-email 2.45.1 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=3532; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=jZc/MIAF/jDIvYGpU+jN9vbQAqj5c02EG/ASWKcQq+E=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+22++fZ9+eEdF4rlXp09ddDe/3HZf7O6LHbssXeOPl mxh3M1l1xHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATYWNimJ/ygM9jn8Exz2zD +P1NsxKMG0OXMDLMFc/dEKeZdTafZT+rhrhNUghr0ubbAA== 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: usb: chipidea: ci_hdrc_imx: Also search for 'phys' phandle When passing 'phys' in the devicetree to describe the USB PHY phandle (which is the recommended way according to Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt) the following NULL pointer dereference is observed on i.MX7 and i.MX8MM: [ 1.489344] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000098 [ 1.498170] Mem abort info: [ 1.500966] ESR = 0x96000044 [ 1.504030] EC = 0x25: DABT (current EL), IL = 32 bits [ 1.509356] SET = 0, FnV = 0 [ 1.512416] EA = 0, S1PTW = 0 [ 1.515569] FSC = 0x04: level 0 translation fault [ 1.520458] Data abort info: [ 1.523349] ISV = 0, ISS = 0x00000044 [ 1.527196] CM = 0, WnR = 1 [ 1.530176] [0000000000000098] user address but active_mm is swapper [ 1.536544] Internal error: Oops: 96000044 [#1] PREEMPT SMP [ 1.542125] Modules linked in: [ 1.545190] CPU: 3 PID: 7 Comm: kworker/u8:0 Not tainted 5.14.0-dirty #3 [ 1.551901] Hardware name: Kontron i.MX8MM N801X S (DT) [ 1.557133] Workqueue: events_unbound deferred_probe_work_func [ 1.562984] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--) [ 1.568998] pc : imx7d_charger_detection+0x3f0/0x510 [ 1.573973] lr : imx7d_charger_detection+0x22c/0x510 This happens because the charger functions check for the phy presence inside the imx_usbmisc_data structure (data->usb_phy), but the chipidea core populates the usb_phy passed via 'phys' inside 'struct ci_hdrc' (ci->usb_phy) instead. This causes the NULL pointer dereference inside imx7d_charger_detection(). Fix it by also searching for 'phys' in case 'fsl,usbphy' is not found. Tested on a imx7s-warp board. The Linux kernel CVE team has assigned CVE-2021-47413 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 746f316b753a and fixed in 5.10.73 with commit b3265b88e83b Issue introduced in 5.8 with commit 746f316b753a and fixed in 5.14.12 with commit 66dd03b10e1c Issue introduced in 5.8 with commit 746f316b753a and fixed in 5.15 with commit 8253a34bfae3 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-47413 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/usb/chipidea/ci_hdrc_imx.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/b3265b88e83b16c7be762fa5fb7e0632bce0002c https://git.kernel.org/stable/c/66dd03b10e1c0b2fae006c6e34c18ea8ee033e7b https://git.kernel.org/stable/c/8253a34bfae3278baca52fc1209b7c29270486ca