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 0521916C85E for ; Wed, 21 Aug 2024 06:12:41 +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=1724220762; cv=none; b=jLRGSSuf/YkaRlycMPOxfpF08e2XOmqcM8/AdTlJC6LqUB4BOklw95qrBvLZyHmAQIEghu8wsvECr5Vl0PBHBFd00y8Qm4VZpoERae/dMQw3d/gNidsCfDQ2yccmOR6HrVUcin1pwGjn7q/FemPLDQrn7WdIJlLSJhK1wPC/0Lw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724220762; c=relaxed/simple; bh=KBqyWwkD+tUqUEh+QYO3rPqZsFzv1t2VZ/aOFaIW6Q4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rxZSxTR5hd6ZZBv6EEgfC0UuDHZPeRALIGvoUiwEJGA54R0B5QRKK8wIAsBzDCYtJ92TxVVPIFeVmRvzLMvLIuBswsZDuZaq/WIguLG22e+lZHYE2GXr6jc2dqgEcsJQ4ybQ3vm3+5pTB3T2DWQJHofTRBztSmvKMIjTehmKrec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vusE+SYw; 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="vusE+SYw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45F74C32782; Wed, 21 Aug 2024 06:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724220761; bh=KBqyWwkD+tUqUEh+QYO3rPqZsFzv1t2VZ/aOFaIW6Q4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vusE+SYwyFx9C1OWZ/EMFDRsE0umERUeJg4lPT3c3qKTlJbZLv2wSyruZFnRV79Mz OrzKKLLcOXT4lnwVlu/G3EQQ1oG3gWHR8brL/xiU7aReskk7Ndmj2wpBg1mEJ+Chpb fWL7CASDfyk9so5UQl+ZUROjtwLlbKDK2jNsqSzs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48898: drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux transfer Date: Wed, 21 Aug 2024 14:11:32 +0800 Message-ID: <2024082111-CVE-2022-48898-0522@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=3946; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=KBqyWwkD+tUqUEh+QYO3rPqZsFzv1t2VZ/aOFaIW6Q4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlHW/4/FGt319t/wvZvkciGj9qz/fR2LZm64P5k5rI3V hUf7uWd74hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJlIozLDi97OnyTRrnPr3b ET3v0FydoIrMs8UM8/R3MN40nTB1ZdVKf6knFzjz4j52uAIA 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: drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux transfer There are 3 possible interrupt sources are handled by DP controller, HPDstatus, Controller state changes and Aux read/write transaction. At every irq, DP controller have to check isr status of every interrupt sources and service the interrupt if its isr status bits shows interrupts are pending. There is potential race condition may happen at current aux isr handler implementation since it is always complete dp_aux_cmd_fifo_tx() even irq is not for aux read or write transaction. This may cause aux read transaction return premature if host aux data read is in the middle of waiting for sink to complete transferring data to host while irq happen. This will cause host's receiving buffer contains unexpected data. This patch fixes this problem by checking aux isr and return immediately at aux isr handler if there are no any isr status bits set. Current there is a bug report regrading eDP edid corruption happen during system booting up. After lengthy debugging to found that VIDEO_READY interrupt was continuously firing during system booting up which cause dp_aux_isr() to complete dp_aux_cmd_fifo_tx() prematurely to retrieve data from aux hardware buffer which is not yet contains complete data transfer from sink. This cause edid corruption. Follows are the signature at kernel logs when problem happen, EDID has corrupt header panel-simple-dp-aux aux-aea0000.edp: Couldn't identify panel via EDID Changes in v2: -- do complete if (ret == IRQ_HANDLED) ay dp-aux_isr() -- add more commit text Changes in v3: -- add Stephen suggested -- dp_aux_isr() return IRQ_XXX back to caller -- dp_ctrl_isr() return IRQ_XXX back to caller Changes in v4: -- split into two patches Changes in v5: -- delete empty line between tags Changes in v6: -- remove extra "that" and fixed line more than 75 char at commit text Patchwork: https://patchwork.freedesktop.org/patch/516121/ The Linux kernel CVE team has assigned CVE-2022-48898 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit c943b4948b58 and fixed in 5.10.164 with commit 785607e5e6fb Issue introduced in 5.10 with commit c943b4948b58 and fixed in 5.15.89 with commit 984ad875db80 Issue introduced in 5.10 with commit c943b4948b58 and fixed in 6.1.7 with commit b7dcbca46db3 Issue introduced in 5.10 with commit c943b4948b58 and fixed in 6.2 with commit 1cba0d150fa1 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-48898 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/gpu/drm/msm/dp/dp_aux.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/785607e5e6fb52caf141e4580de40405565f04f1 https://git.kernel.org/stable/c/984ad875db804948c86ca9e1c2e784ae8252715a https://git.kernel.org/stable/c/b7dcbca46db3c77fdb02c2a9d6239e5aa3b06a59 https://git.kernel.org/stable/c/1cba0d150fa102439114a91b3e215909efc9f169