libxc/restore: Fix REC_TYPE_X86_PV_VCPU_XSAVE data auditing (take 2)
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 4 Feb 2020 20:29:38 +0000 (20:29 +0000)
committerWei Liu <wl@xen.org>
Wed, 5 Feb 2020 12:02:42 +0000 (12:02 +0000)
commit0729830cc425a8ff27a3137e87b93768ae3c853c
tree5cde6fe0f9fc5bdcf56a859aa2e3692d9dee5f2f
parentd00377890a3c62e0e925d171b6b839406b6d134d
libxc/restore: Fix REC_TYPE_X86_PV_VCPU_XSAVE data auditing (take 2)

It turns out that a bug (since forever) in Xen causes XSAVE records to have
non-architectural behaviour on xsave-capable hardware, when a PV guest has not
touched the state.

In such a case, the data record returned from Xen is 2*uint64_t, both claiming
the (illegitimate) state of %xcr0 and %xcr0_accum being 0.

Adjust the bound in handle_x86_pv_vcpu_blob() to cope with this.

Fixes: 2a62c22715b "libxc/restore: Fix data auditing in handle_x86_pv_vcpu_blob()"
Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libxc/xc_sr_restore_x86_pv.c