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 D4DBF1EF391 for ; Thu, 1 May 2025 14:17:06 +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=1746109026; cv=none; b=EeCWssBHWFPePMLnR207feGabYZKnWWRSnkTTM5e+tvji9NcP0S4wHaE/fUApPko2KDiFF7WcizqCiLK/+LYqnzBdLgyRxFi0PwAfk8XbXPyKkF3I6AJLC9uHjEJtY+zRnVIl2liAz8a+2Dyln+MWsDSTBK6n+AkgobWVwYZDc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109026; c=relaxed/simple; bh=pjpzRyJhkCam8wgS5ixdHvIz31b5SfdbqP/yiTSupM4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IbzrI7gaokvbkpPFtfhwXpemD/7gSL/9dmWbgkaAS0reNTNA4krDjRRDCEfVYBKA7Q50PJoiLiNRimAyhJ9OKyyi/QrSbs7O+AtCt2ESHRc0LX7xA974ZxfHylcAK+hO3Qpcu9TFFVX/cvf0L0dgcZwMdf4KgtyrCmuDCR8kXrA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ganr29lu; 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="Ganr29lu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A02AC4CEE3; Thu, 1 May 2025 14:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746109026; bh=pjpzRyJhkCam8wgS5ixdHvIz31b5SfdbqP/yiTSupM4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Ganr29lu0EsNlDgk3aPdLvw755igQbAG5E1UK4nca1MbupZ2l0ZQ7O3fp+kQMeHER smqFjVyMwzelFd0yx27wv0Z0qyDjL7HuYaZhu+9d2fHLBYt5GkfEnpC3KhgVyN5DFW S1I9d1OqRHZ9lOV9veFPRZ4VXtQH9p20hQDY4uZU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49886: x86/tdx: Panic on bad configs that #VE on "private" memory access Date: Thu, 1 May 2025 16:11:16 +0200 Message-ID: <2025050156-CVE-2022-49886-3c97@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=2955; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=bOAVqiajxL5sPt0jdkWxkfiCq3g8EJhjcyb8+CpSnB0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDVtemnzgnvnowIJP5V95DFgWfJrUe8mE7162WlZOl nbKhpV6HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARyWkMCxY9+egQuXGNz3pf v5edt7MCZuVf6WZYsCndROix4YIXnMuP11pE6HStsDgVCgA= 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: x86/tdx: Panic on bad configs that #VE on "private" memory access All normal kernel memory is "TDX private memory". This includes everything from kernel stacks to kernel text. Handling exceptions on arbitrary accesses to kernel memory is essentially impossible because they can happen in horribly nasty places like kernel entry/exit. But, TDX hardware can theoretically _deliver_ a virtualization exception (#VE) on any access to private memory. But, it's not as bad as it sounds. TDX can be configured to never deliver these exceptions on private memory with a "TD attribute" called ATTR_SEPT_VE_DISABLE. The guest has no way to *set* this attribute, but it can check it. Ensure ATTR_SEPT_VE_DISABLE is set in early boot. panic() if it is unset. There is no sane way for Linux to run with this attribute clear so a panic() is appropriate. There's small window during boot before the check where kernel has an early #VE handler. But the handler is only for port I/O and will also panic() as soon as it sees any other #VE, such as a one generated by a private memory access. [ dhansen: Rewrite changelog and rebase on new tdx_parse_tdinfo(). Add Kirill's tested-by because I made changes since he wrote this. ] The Linux kernel CVE team has assigned CVE-2022-49886 to this issue. Affected and fixed versions =========================== Issue introduced in 5.19 with commit 9a22bf6debbf5169f750af53c7f86eb4e3cd6712 and fixed in 6.0.8 with commit 895c168c8f78079f21ad50fead7593ffa352f795 Issue introduced in 5.19 with commit 9a22bf6debbf5169f750af53c7f86eb4e3cd6712 and fixed in 6.1 with commit 373e715e31bf4e0f129befe87613a278fac228d3 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-49886 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/x86/coco/tdx/tdx.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/895c168c8f78079f21ad50fead7593ffa352f795 https://git.kernel.org/stable/c/373e715e31bf4e0f129befe87613a278fac228d3