Skip to content

Commit b6fb565

Browse files
kirylhansendc
authored andcommitted
x86/tdx: Fix data leak in mmio_read()
The mmio_read() function makes a TDVMCALL to retrieve MMIO data for an address from the VMM. Sean noticed that mmio_read() unintentionally exposes the value of an initialized variable (val) on the stack to the VMM. This variable is only needed as an output value. It did not need to be passed to the VMM in the first place. Do not send the original value of *val to the VMM. [ dhansen: clarify what 'val' is used for. ] Fixes: 31d58c4 ("x86/tdx: Handle in-kernel MMIO") Reported-by: Sean Christopherson <[email protected]> Signed-off-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Cc:[email protected] Link: https://lore.kernel.org/all/20240826125304.1566719-1-kirill.shutemov%40linux.intel.com
1 parent ea72ce5 commit b6fb565

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/x86/coco/tdx/tdx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ static bool mmio_read(int size, unsigned long addr, unsigned long *val)
389389
.r12 = size,
390390
.r13 = EPT_READ,
391391
.r14 = addr,
392-
.r15 = *val,
393392
};
394393

395394
if (__tdx_hypercall(&args))

0 commit comments

Comments
 (0)