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 CE3E825A324 for ; Fri, 2 May 2025 15:57:45 +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=1746201465; cv=none; b=npCSy1FYlswAsWbZFjxHWUjyQ4zfj0oFb5YVCQ3PLp+TBysapjAn2+LdrAwbybEnnEMbqnhuBPtMtDmB6jJhjRkV4I7r4acrLIV3LW7IfypMLJlYqdvzu0YzhNfzuoz8VMnvbzUMSRxT8reMBiGZVzv8aPni+RwyFFDXJnV/wOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746201465; c=relaxed/simple; bh=BhTUigEUS7IUaPNF/V4RP+WoUux4MQeRAqU1L9fAPoE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=s6WkEQG+Z+hHJoj44UG9tr3omct9KIh/fHfH9ygWbR3tGmZM41u1Gk/V4dWsM+vbkKM/RbPs/20dcJ5lPhDKZklYpzPjhru2DrLHK6mEFsaNdKLXMOxJlE6/o/ZF+T+BSM8QpADJEu9liWeHJ89d4FyD++1RoAmbjkqeriVDlPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=s8atTAkZ; 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="s8atTAkZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CEFFC4CEE4; Fri, 2 May 2025 15:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746201465; bh=BhTUigEUS7IUaPNF/V4RP+WoUux4MQeRAqU1L9fAPoE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=s8atTAkZyTqwIKBiiJ6rjYtu/i/p8pLV5yt3WJm6x+cSzzs6A7+7+W11aOHSI96ud ZAEVyMDuCOZpuaDTl7waJPi2EntRvdqEiHr94OLtu7C26zAx8/QeEFlh78S+ZooJj2 juGVzk69/TuzOKTupYw03tt47c/lB2qy+qqH2J5I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53048: usb: typec: tcpm: fix warning when handle discover_identity message Date: Fri, 2 May 2025 17:55:13 +0200 Message-ID: <2025050205-CVE-2023-53048-7076@gregkh> X-Mailer: git-send-email 2.49.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=4621; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vTA/LaHWfNEsyL3ljIL6lS3XVdggrau7Sc0e/a/uTBQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkir25uU0sTCq/o/5Vxx2SZqkqLc3Sx0vuux027G0Q/7 b+svHFfRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzE/hfD/BLNyw+/+J5+IR/S YvVyX3FMR83DEwzz0ycKv9XV8Oa35FwY+Pr+N2e/U6c6AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: usb: typec: tcpm: fix warning when handle discover_identity message Since both source and sink device can send discover_identity message in PD3, kernel may dump below warning: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 169 at drivers/usb/typec/tcpm/tcpm.c:1446 tcpm_queue_vdm+0xe0/0xf0 Modules linked in: CPU: 0 PID: 169 Comm: 1-0050 Not tainted 6.1.1-00038-g6a3c36cf1da2-dirty #567 Hardware name: NXP i.MX8MPlus EVK board (DT) pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : tcpm_queue_vdm+0xe0/0xf0 lr : tcpm_queue_vdm+0x2c/0xf0 sp : ffff80000c19bcd0 x29: ffff80000c19bcd0 x28: 0000000000000001 x27: ffff0000d11c8ab8 x26: ffff0000d11cc000 x25: 0000000000000000 x24: 00000000ff008081 x23: 0000000000000001 x22: 00000000ff00a081 x21: ffff80000c19bdbc x20: 0000000000000000 x19: ffff0000d11c8080 x18: ffffffffffffffff x17: 0000000000000000 x16: 0000000000000000 x15: ffff0000d716f580 x14: 0000000000000001 x13: ffff0000d716f507 x12: 0000000000000001 x11: 0000000000000000 x10: 0000000000000020 x9 : 00000000000ee098 x8 : 00000000ffffffff x7 : 000000000000001c x6 : ffff0000d716f580 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 x2 : ffff80000c19bdbc x1 : 00000000ff00a081 x0 : 0000000000000004 Call trace: tcpm_queue_vdm+0xe0/0xf0 tcpm_pd_rx_handler+0x340/0x1ab0 kthread_worker_fn+0xcc/0x18c kthread+0x10c/0x110 ret_from_fork+0x10/0x20 ---[ end trace 0000000000000000 ]--- Below sequences may trigger this warning: tcpm_send_discover_work(work) tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0); tcpm_queue_vdm(port, header, data, count); port->vdm_state = VDM_STATE_READY; vdm_state_machine_work(work); <-- received discover_identity from partner vdm_run_state_machine(port); port->vdm_state = VDM_STATE_SEND_MESSAGE; mod_vdm_delayed_work(port, x); tcpm_pd_rx_handler(work); tcpm_pd_data_request(port, msg); tcpm_handle_vdm_request(port, msg->payload, cnt); tcpm_queue_vdm(port, response[0], &response[1], rlen - 1); --> WARN_ON(port->vdm_state > VDM_STATE_DONE); For this case, the state machine could still send out discover identity message later if we skip current discover_identity message. So we should handle the received message firstly and override the pending discover_identity message without warning in this case. Then, a delayed send_discover work will send discover_identity message again. The Linux kernel CVE team has assigned CVE-2023-53048 to this issue. Affected and fixed versions =========================== Issue introduced in 5.13 with commit e00943e916782ae17ca05d654779a84f09481ab8 and fixed in 5.15.105 with commit bb579b3f75c60bf488a7c36e092e8be583407d53 Issue introduced in 5.13 with commit e00943e916782ae17ca05d654779a84f09481ab8 and fixed in 6.1.22 with commit d55ca2d2ea1a7ec553213986993fba8c0257381c Issue introduced in 5.13 with commit e00943e916782ae17ca05d654779a84f09481ab8 and fixed in 6.2.9 with commit e37d2c489d71e94ed4a39529bc9520a7fd983d42 Issue introduced in 5.13 with commit e00943e916782ae17ca05d654779a84f09481ab8 and fixed in 6.3 with commit abfc4fa28f0160df61c7149567da4f6494dfb488 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-2023-53048 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/typec/tcpm/tcpm.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/bb579b3f75c60bf488a7c36e092e8be583407d53 https://git.kernel.org/stable/c/d55ca2d2ea1a7ec553213986993fba8c0257381c https://git.kernel.org/stable/c/e37d2c489d71e94ed4a39529bc9520a7fd983d42 https://git.kernel.org/stable/c/abfc4fa28f0160df61c7149567da4f6494dfb488