lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260106102318.25227-1-yan.y.zhao@intel.com>
Date: Tue,  6 Jan 2026 18:23:18 +0800
From: Yan Zhao <yan.y.zhao@...el.com>
To: pbonzini@...hat.com,
	seanjc@...gle.com
Cc: linux-kernel@...r.kernel.org,
	kvm@...r.kernel.org,
	x86@...nel.org,
	rick.p.edgecombe@...el.com,
	dave.hansen@...el.com,
	kas@...nel.org,
	tabba@...gle.com,
	ackerleytng@...gle.com,
	michael.roth@....com,
	david@...nel.org,
	vannapurve@...gle.com,
	sagis@...gle.com,
	vbabka@...e.cz,
	thomas.lendacky@....com,
	nik.borisov@...e.com,
	pgonda@...gle.com,
	fan.du@...el.com,
	jun.miao@...el.com,
	francescolavra.fl@...il.com,
	jgross@...e.com,
	ira.weiny@...el.com,
	isaku.yamahata@...el.com,
	xiaoyao.li@...el.com,
	kai.huang@...el.com,
	binbin.wu@...ux.intel.com,
	chao.p.peng@...el.com,
	chao.gao@...el.com,
	yan.y.zhao@...el.com
Subject: [PATCH v3 18/24] x86/virt/tdx: Add loud warning when tdx_pamt_put() fails.

tdx_pamt_put() does not return any error to its caller when SEAMCALL
TDH_PHYMEM_PAMT_REMOVE fails. Though pamt_refcount for the failed 2MB
physical range is increased (so the DPAMT pages stay added), it will cause
that the 2MB physical range can only be mapped at 4KB level, i.e., later
SEAMCALL TDH_MEM_PAGE_AUG on the 2MB range at 2MB level will therefore fail
forever.

Since tdx_pamt_put() only fails when there are bugs in the host kernel or
in the TDX module, simply add a loud warning to aid debugging after such an
error occurs.

Link: https://lore.kernel.org/all/67d55b24ef1a80af615c3672e8436e0ac32e8efa.camel@intel.com
Suggested-by: Rick Edgecombe <rick.p.edgecombe@...el.com>
Signed-off-by: Yan Zhao <yan.y.zhao@...el.com>
---
v3:
- new patch
---
 arch/x86/virt/vmx/tdx/tdx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index c12665389b67..76963c563906 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -2348,8 +2348,7 @@ void tdx_pamt_put(struct page *page)
 			 */
 			atomic_inc(pamt_refcount);
 
-			pr_err("TDH_PHYMEM_PAMT_REMOVE failed: %#llx\n", tdx_status);
-
+			WARN_ONCE(1, "TDH_PHYMEM_PAMT_REMOVE failed: %#llx\n", tdx_status);
 			/*
 			 * Don't free pamt_pa_array as it could hold garbage
 			 * when tdh_phymem_pamt_remove() fails.
-- 
2.43.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ