]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/PV: further harden guest memory accesses against speculative abuse
authorJan Beulich <jbeulich@suse.com>
Mon, 27 Jan 2025 14:23:59 +0000 (15:23 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 27 Jan 2025 14:23:59 +0000 (15:23 +0100)
commit8306d773b03acec6062c0547ac05e3dd4a6960f6
tree08012ccaf6f081a5decf99bafdf7a6fd42952e05
parent5310a042c4e3135c471446c8253ad13250539957
x86/PV: further harden guest memory accesses against speculative abuse

The original implementation has two issues: For one it doesn't preserve
non-canonical-ness of inputs in the range 0x8000000000000000 through
0x80007fffffffffff. Bogus guest pointers in that range would not cause a
(#GP) fault upon access, when they should.

And then there is an AMD-specific aspect, where only the low 48 bits of
an address are used for speculative execution; the architecturally
mandated #GP for non-canonical addresses would be raised at a later
execution stage. Therefore to prevent Xen controlled data to make it
into any of the caches in a guest controllable manner, we need to
additionally ensure that for non-canonical inputs bit 47 would be clear.

See the code comment for how addressing both is being achieved.

Fixes: 4dc181599142 ("x86/PV: harden guest memory accesses against speculative abuse")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/include/asm/asm-defns.h