File CVE-2013-4529-02-qemuu-pci-fix-buffer-overrun-on-invalid-state-load.patch of Package xen.7673
References: bsc#964929 CVE-2013-4529
Subject: vmstate: add VMSTATE_VALIDATE
From: Michael S. Tsirkin mst@redhat.com Thu Apr 3 19:50:35 2014 +0300
Date: Mon May 5 14:15:10 2014 +0200:
Git: 4082f0889ba04678fc14816c53e1b9251ea9207e
Validate state using VMS_ARRAY with num = 0 and VMS_MUST_EXIST
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Index: xen-4.4.4-testing/tools/qemu-xen-dir-remote/include/migration/vmstate.h
===================================================================
--- xen-4.4.4-testing.orig/tools/qemu-xen-dir-remote/include/migration/vmstate.h
+++ xen-4.4.4-testing/tools/qemu-xen-dir-remote/include/migration/vmstate.h
@@ -204,6 +204,14 @@ extern const VMStateInfo vmstate_info_bi
.offset = vmstate_offset_value(_state, _field, _type), \
}
+/* Validate state using a boolean predicate. */
+#define VMSTATE_VALIDATE(_name, _test) { \
+ .name = (_name), \
+ .field_exists = (_test), \
+ .flags = VMS_ARRAY | VMS_MUST_EXIST, \
+ .num = 0, /* 0 elements: no data, only run _test */ \
+}
+
#define VMSTATE_POINTER(_field, _state, _version, _info, _type) { \
.name = (stringify(_field)), \
.version_id = (_version), \