]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
x86/traps: Fix load_unaligned_zeropad() handling for shared TDX memory
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Mon, 24 Jul 2023 23:03:29 +0000 (02:03 +0300)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:20:49 +0000 (17:20 +0200)
commit5560457757d4ba455d769fe3ea2b856f2eac0ac6
tree0a8e8cdbe0801fc5e265104634e767391b62c87a
parentf9a209387f672bc92b0c6747db98a51484d6e097
x86/traps: Fix load_unaligned_zeropad() handling for shared TDX memory

BugLink: https://bugs.launchpad.net/bugs/2037005
[ Upstream commit 9f9116406120638b4d8db3831ffbc430dd2e1e95 ]

Commit c4e34dd99f2e ("x86: simplify load_unaligned_zeropad()
implementation") changes how exceptions around load_unaligned_zeropad()
handled.  The kernel now uses the fault_address in fixup_exception() to
verify the address calculations for the load_unaligned_zeropad().

It works fine for #PF, but breaks on #VE since no fault address is
passed down to fixup_exception().

Propagating ve_info.gla down to fixup_exception() resolves the issue.

See commit 1e7769653b06 ("x86/tdx: Handle load_unaligned_zeropad()
page-cross to a shared page") for more context.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Michael Kelley <mikelley@microsoft.com>
Fixes: c4e34dd99f2e ("x86: simplify load_unaligned_zeropad() implementation")
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
arch/x86/kernel/traps.c