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 42414140391 for ; Mon, 24 Jun 2024 13:52:39 +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=1719237160; cv=none; b=kd5EaA8kPoNlx4f2A5w5cBNCcJeJZnUZjCY/xAEWhrsitnlFCPabg6o9NkrszjX7h7NmfczK2LF7Y24lMzaXf9cPwj/ecHT/Er6vU7GYCybkoPoiV/4wAY602ZhKcVmTVDRLEvAA2cAK6rAYb6dQ73EwpIt+FQZ3B/CO1avK4OA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719237160; c=relaxed/simple; bh=KUExZg7sERPysu+Bd0HjvNIU45cSN1yS05GsIVrXMj4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Evu3aKQwROFOvMzDfuuqOfJHo0cN9/+nedGf1waaxlgLLb1VNufCzemPtbhvfHTfz36cJAwyDBKy1LsGiD6UravTdRqe33xINg7TMCCtFMfwwOD6LLFW/9dFhG806Q48VEVoN3FLevsRd+6LD5IJ+h+HFO5vIaT7K29c1c+pvcs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CNXck7EC; 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="CNXck7EC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BD03C2BBFC; Mon, 24 Jun 2024 13:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719237159; bh=KUExZg7sERPysu+Bd0HjvNIU45cSN1yS05GsIVrXMj4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CNXck7ECCmgkFOwvabiTGRYomLRSQRAtNtf/diezXTbNg++iMFpE7G+Zx2zmuohBJ caGUsmqu9FdSL2mM+0WBe9QeNO69TWcTx1Nuc0CfEeTGZM4bIp7tcub9utuGvyuc0V I+/WQZZt8ydn1H0/g1vBUaCGDYF8uGUVgUDXoQQ0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38667: riscv: prevent pt_regs corruption for secondary idle threads Date: Mon, 24 Jun 2024 15:52:31 +0200 Message-ID: <2024062431-CVE-2024-38667-83a6@gregkh> X-Mailer: git-send-email 2.45.2 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=2726; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=KUExZg7sERPysu+Bd0HjvNIU45cSN1yS05GsIVrXMj4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmVVQoKVvPO6++dNZE98oWDXstKltAp90IFnTvmhV0Vr dp/Q+lpRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkiTrDHP6W/a/8uyYa6GY7 7qs4xz/f2br4HsM8NfObkkUJomafN7PyKj6OrXZVD/gCAA== 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: riscv: prevent pt_regs corruption for secondary idle threads Top of the kernel thread stack should be reserved for pt_regs. However this is not the case for the idle threads of the secondary boot harts. Their stacks overlap with their pt_regs, so both may get corrupted. Similar issue has been fixed for the primary hart, see c7cdd96eca28 ("riscv: prevent stack corruption by reserving task_pt_regs(p) early"). However that fix was not propagated to the secondary harts. The problem has been noticed in some CPU hotplug tests with V enabled. The function smp_callin stored several registers on stack, corrupting top of pt_regs structure including status field. As a result, kernel attempted to save or restore inexistent V context. The Linux kernel CVE team has assigned CVE-2024-38667 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 2875fe056156 and fixed in 6.1.93 with commit ea22d4195cca Issue introduced in 5.7 with commit 2875fe056156 and fixed in 6.6.33 with commit 3090c06d50ea Issue introduced in 5.7 with commit 2875fe056156 and fixed in 6.9.4 with commit 0c1f28c32a19 Issue introduced in 5.7 with commit 2875fe056156 and fixed in 6.10-rc2 with commit a638b0461b58 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-2024-38667 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: arch/riscv/kernel/cpu_ops_sbi.c arch/riscv/kernel/cpu_ops_spinwait.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/ea22d4195cca13d5fdbc4d6555a2dfb8a7867a9e https://git.kernel.org/stable/c/3090c06d50eaa91317f84bf3eac4c265e6cb8d44 https://git.kernel.org/stable/c/0c1f28c32a194303da630fca89481334b9547b80 https://git.kernel.org/stable/c/a638b0461b58aa3205cd9d5f14d6f703d795b4af