x86/hvm: block speculative out-of-bound accesses
authorNorbert Manthey <nmanthey@amazon.de>
Tue, 12 Feb 2019 14:20:15 +0000 (15:20 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Feb 2019 14:20:15 +0000 (15:20 +0100)
commitf178a00c30173c0b268d99160e19ad299b1823a2
tree6e8fc53e56c2cd2af5ac437ab87e2f2ff584bb90
parent56d8d0119d270f846c6c4943712b8a21fbe5d4d0
x86/hvm: block speculative out-of-bound accesses

There are multiple arrays in the HVM interface that are accessed
with indices that are provided by the guest. To avoid speculative
out-of-bound accesses, we use the array_index_nospec macro.

When blocking speculative out-of-bound accesses, we can classify arrays
into dynamic arrays and static arrays. Where the former are allocated
during run time, the size of the latter is known during compile time.
On static arrays, compiler might be able to block speculative accesses
in the future.

This is part of the speculative hardening effort.

Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/hvm/hvm.c