]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commit
usb: fix up post load checks
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 13 May 2014 09:33:16 +0000 (12:33 +0300)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 14:53:21 +0000 (14:53 +0000)
commitd0737b7b2ccbcc6526f4e61e277caceefff08cf9
tree1cbbd0e098d8994e680628d054b8866b4c4c995e
parent29236c2ea0cc67fa831e2eb75ee729615c950751
usb: fix up post load checks

Correct post load checks:
1. dev->setup_len == sizeof(dev->data_buf)
    seems fine, no need to fail migration
2. When state is DATA, passing index > len
   will cause memcpy with negative length,
   resulting in heap overflow

First of the issues was reported by dgilbert.

Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
hw/usb/bus.c