xen/arm: domain: Zero the per-vCPU cpu_info
authorJulien Grall <julien.grall@arm.com>
Tue, 12 Jun 2018 11:36:31 +0000 (12:36 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 22 Jun 2018 01:55:12 +0000 (02:55 +0100)
commit213aa75aece5efefe76448c86b50b957901c7baf
tree316a2e06cbb14742c65899f948e47c42e1b6a39c
parent21c0b1a3c1a0483f99174b21eb5c1620d71e348c
xen/arm: domain: Zero the per-vCPU cpu_info

A stack is allocated per vCPU to be used by Xen. The allocation is done
with alloc_xenheap_pages that does not zero the memory returned. However
the top of the stack is containing information that will be used to
store the initial state of the vCPU (see struct cpu_info). Some of the
fields may not be initialized and will lead to use/leak bits of previous
memory in some cases on the first run of vCPU (AFAICT this only happen on
vCPU0 for Dom0).

This is part of XSA-263.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain.c