From mboxrd@z Thu Jan 1 00:00:00 1970 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 79B0544369 for ; Wed, 13 Mar 2024 14:02:04 +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=1710338524; cv=none; b=hBRZYR/ZpWKWNlFg97w1sI4H6gVoHgt7WWz31y86+gDLNyGYDnU9uEvUy9dT6cC03OpHF1jkQRdhNFFekQhBwr8XrEz4MFhNOP+n/6Ru/cyCWsBRgSq42SMVF1lG1J72VwPKjbQ39XvKB4at5Scd65Usurn9NSV12AvxpuSnFy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710338524; c=relaxed/simple; bh=8GnMve8J1ElAqmnZnpQ8Y2PBeIGr6MmgiTAuPdhE3EU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XME0vi6MZ7YfKFv/32tpxuZfLEVChrheeb7o2wtKt91LhME8Dq5PEZ2G9u+/VuWf/cuQ1nP5ZsST8Ajwlfu8RRLIViWTNwv/arek3sUvkcDU6QZNocoiBfk7iGIW6e0VMc7fLtVqHO9bSM5jjXpLyhdQPuUhg0tNjSh8/7tOGiI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AvlOBfpU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AvlOBfpU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 536CDC433F1; Wed, 13 Mar 2024 14:02:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710338524; bh=8GnMve8J1ElAqmnZnpQ8Y2PBeIGr6MmgiTAuPdhE3EU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=AvlOBfpUMQSyWbD24RGKHewzeCBx5gkQ74sTicJIQ4QPzbbYDOtziPcbJVVOywrOH KieNLdowqtWEENk2j5dfOtAO1fecsJY1DCCEhhFrCD5WD/xbxlls4uPD+vP6gHQoAH KyPPnDmDod5z0t2PzlWXc2twEeREzzHiOlzNg+a9NmaS7J0Hn7Yf+cueqXVcVqaELk 6stL/MoYnofzwKFYHqjz0DNwJ10yktOvpiRBez+9owLh4uhXa3eZT0LpsUbdIh3DKV 0bDvE65EdFyr1Gq7yCCfywrbvlPLsomkU4+SRXjfG3bvjOYoIQaS6vPSQVVKEG+T/U iT0mQ5MeAr0Yg== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2023-52608: firmware: arm_scmi: Check mailbox/SMT channel for consistency Date: Wed, 13 Mar 2024 14:01:56 +0000 Message-ID: <20240313140155.1913910-3-lee@kernel.org> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog 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=3650; i=lee@kernel.org; h=from:subject; bh=8GnMve8J1ElAqmnZnpQ8Y2PBeIGr6MmgiTAuPdhE3EU=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBl8bHTCELRq9RecuPX9HvMrLCbyN2jc5tXJ8VVy XZeBQyokx6JAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZfGx0wAKCRBRr4ovh/x3 YXoREAC1fqny4DuyoVLFkPzGoDdBqyND3Fg9KMKfkKeY7yRqVMssl2njhxGZuyWEmruu2T+zCJc JSL8DLOIcXbhTDJQ8wcBpgG6fVL2KqFm9yHaaBDoYr2AgmRFARgkpnmNEaFmZAsssT17tznjzYV Qn6S3e0rWlqSqIfz4tIis8HS48QIvUlGImde9KGDOJqDK8lCAf0mRe4Cr66v1jVaRwZgGgbz5Ag mhamc8Cug6VDsiVC7fG+MGUlZIvdTesWCO8+cICfYSARvxPeBedLRN48qvLbkDAjQBwJD4voPTA g2p/+sBkTb9hEJZ/98zHnKmPZJKnG27KmoTRUAyFq4yWQeGoFa4lHHzYsKViVzZcIDEQ0emSemR X6KMvFdyVZh35KB7PCUfucJapQDwqQDLtsJsYp+jCSw4UtjLBgc1cTV4WK6+qTG4BjDcjO06Ldg F9/Z6yd768DQ4PhZjcWldnfSJ92gZAqB3OnlKEFpZXhFLU33JZywKpvRbDkpv6Q2e7J9EZmiRLQ dNU1WKXSLAUj8u+3SWsjJCq/xEQ7vdAaKsDjpuGsdhd005g4ICEGnij7r9fbY+vfoFRck0URkA0 hUCrQfq62bJTnEFNryUMU4yfaV3AX7SvqzZDz0PhFRaQTVw4yKSA/aqQEKVrd8K+lV9G4ts5G9V ggL+ZftY8c1QOQg== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: firmware: arm_scmi: Check mailbox/SMT channel for consistency On reception of a completion interrupt the shared memory area is accessed to retrieve the message header at first and then, if the message sequence number identifies a transaction which is still pending, the related payload is fetched too. When an SCMI command times out the channel ownership remains with the platform until eventually a late reply is received and, as a consequence, any further transmission attempt remains pending, waiting for the channel to be relinquished by the platform. Once that late reply is received the channel ownership is given back to the agent and any pending request is then allowed to proceed and overwrite the SMT area of the just delivered late reply; then the wait for the reply to the new request starts. It has been observed that the spurious IRQ related to the late reply can be wrongly associated with the freshly enqueued request: when that happens the SCMI stack in-flight lookup procedure is fooled by the fact that the message header now present in the SMT area is related to the new pending transaction, even though the real reply has still to arrive. This race-condition on the A2P channel can be detected by looking at the channel status bits: a genuine reply from the platform will have set the channel free bit before triggering the completion IRQ. Add a consistency check to validate such condition in the A2P ISR. The Linux kernel CVE team has assigned CVE-2023-52608 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 5c8a47a5a91d and fixed in 5.15.149 with commit 614cc65032dc Issue introduced in 5.7 with commit 5c8a47a5a91d and fixed in 6.1.76 with commit 7f95f6997f4f Issue introduced in 5.7 with commit 5c8a47a5a91d and fixed in 6.6.15 with commit 9b5e1b93c83e Issue introduced in 5.7 with commit 5c8a47a5a91d and fixed in 6.7.3 with commit 12dc4217f165 Issue introduced in 5.7 with commit 5c8a47a5a91d and fixed in 6.8-rc2 with commit 437a310b2224 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-52608 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/firmware/arm_scmi/common.h drivers/firmware/arm_scmi/mailbox.c drivers/firmware/arm_scmi/shmem.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/614cc65032dcb0b64d23f5c5e338a8a04b12be5d https://git.kernel.org/stable/c/7f95f6997f4fdd17abec3200cae45420a5489350 https://git.kernel.org/stable/c/9b5e1b93c83ee5fc9f5d7bd2d45b421bd87774a2 https://git.kernel.org/stable/c/12dc4217f16551d6dee9cbefc23fdb5659558cda https://git.kernel.org/stable/c/437a310b22244d4e0b78665c3042e5d1c0f45306