projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d8fa6a
)
libxc/restore: Fix data auditing in handle_x86_pv_vcpu_blob()
author
Andrew Cooper
<andrew.cooper3@citrix.com>
Thu, 19 Dec 2019 20:32:20 +0000
(20:32 +0000)
committer
Ian Jackson
<ian.jackson@eu.citrix.com>
Tue, 5 May 2020 14:47:21 +0000
(15:47 +0100)
The current logic only works by chance, in that XSAVE records also tend to be
a multiple of 128. Implement the missing logic for XSAVE.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit
2a62c22715bf81c5695ae0511f89a940c7c6a492
)
(cherry picked from commit
0e2bbcf8b4fe6f5fd23a341848f3785c213b26bb
)
(cherry picked from commit
288872ad3bb320bd9f31145d9bd4e53786fa3245
)
tools/libxc/xc_sr_restore_x86_pv.c
patch
|
blob
|
history
diff --git
a/tools/libxc/xc_sr_restore_x86_pv.c
b/tools/libxc/xc_sr_restore_x86_pv.c
index 0f0275199256d62dd563343794d034ae5e354cf5..8c7adaeeda4b2d25c12d08b7ccc2502dec9be0ac 100644
(file)
--- a/
tools/libxc/xc_sr_restore_x86_pv.c
+++ b/
tools/libxc/xc_sr_restore_x86_pv.c
@@
-825,6
+825,15
@@
static int handle_x86_pv_vcpu_blob(struct xc_sr_context *ctx,
break;
case REC_TYPE_X86_PV_VCPU_XSAVE:
+ if ( blobsz < 128 )
+ {
+ ERROR("%s record too short: min %zu, got %u",
+ rec_name, sizeof(*vhdr) + 128, rec->length);
+ goto out;
+ }
+ break;
+
+ case REC_TYPE_X86_PV_VCPU_MSRS:
if ( blobsz % sizeof(xen_domctl_vcpu_msr_t) != 0 )
{
ERROR("%s record payload size %zu expected to be a multiple of %zu",