summaryrefslogtreecommitdiff
path: root/vmstate.c
AgeCommit message (Collapse)AuthorFilesLines
2014-07-20vmstate: fix buffer overflow in target-arm/machine.cMichael S. Tsirkin1-3/+4
CVE-2013-4531 cpreg_vmstate_indexes is a VARRAY_INT32. A negative value for cpreg_vmstate_array_len will cause a buffer overflow. VMSTATE_INT32_LE was supposed to protect against this but doesn't because it doesn't validate that input is non-negative. Fix this macro to valide the value appropriately. The only other user of VMSTATE_INT32_LE doesn't ever use negative numbers so it doesn't care. Reported-by: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> (cherry picked from commit d2ef4b61fe6d33d2a5dcf100a9b9440de341ad62) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2014-07-20vmstate: add VMS_MUST_EXISTMichael S. Tsirkin1-0/+10
Can be used to verify a required field exists or validate state in some other way. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> (cherry picked from commit 5bf81c8d63db0216a4d29dc87f9ce530bb791dd1) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2014-07-20vmstate: reduce code duplicationMichael S. Tsirkin1-48/+52
move size offset and number of elements math out to functions, to reduce code duplication. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> (cherry picked from commit 35fc1f71899fd42323bd8f33da18f0211e0d2727) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2014-03-27migration: add more tracesAlexey Kardashevskiy1-0/+2
This replaces DPRINTF macro with tracepoints. This moves some messages from migration.c to savevm.c. This adds tracepoint to signal about fileds failed to migrate. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2014-02-25Fix vmstate_info_int32_le comparison/assignDr. David Alan Gilbert1-7/+8
Fix comparison of vmstate_info_int32_le so that it succeeds if loaded value is (l)ess than or (e)qual When the comparison succeeds, assign the value loaded This is a change in behaviour but I think the original intent, since the idea is to check if the version/size of the thing you're loading is less than some limit, but you might well want to do something based on the actual version/size in the file Fix up comment and name text Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-01-13vmstate: Move VMState code to vmstate.cEduardo Habkost1-0/+650
This will allow unit tests to be written for VMState code without pulling dependencies from the savevm code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>