x86/hvm/viridian: zero and check vcpu context _pad field
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 31 Mar 2016 12:49:50 +0000 (14:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 31 Mar 2016 12:49:50 +0000 (14:49 +0200)
commit646c3128440fd998c634b6f26a46b2bb7fe9515a
tree9ce547fa4286ac9ef4978ba74ceecde9f003dbc7
parentd275ec9ca8a86f7c9c213f3551194d471ce90fbd
x86/hvm/viridian: zero and check vcpu context _pad field

Commit 57844631 "save APIC assist vector" added an extra field to the
viridian vcpu context save record. This field was only a uint8_t and
so an extra _pad field was also added to pad up to the next 64-bit
boundary.

This patch makes sure that _pad field is zeroed on save and checked
for zero on restore. This prevents a potential leak of information
from the stack and a compatibility check against future use of the
space occupied by the _pad field.

The _pad field is zeroed as a side effect of making use of a C99 struct
initializer for the other fields. This patch also modifies the domain
context save code to use the same mechanism.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/viridian.c
xen/arch/x86/mm.c
xen/include/asm-x86/mm.h