]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Handle copying bitmaps to larger data buffers
authorAllen, John <John.Allen@amd.com>
Mon, 15 Apr 2019 14:43:07 +0000 (14:43 +0000)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 25 Apr 2019 08:18:48 +0000 (10:18 +0200)
commit51f9f80d350e633adf479c6a9b3c55f82ca9cbd4
treee9ddd34e1695604c35125d889051b7af82384507
parent055af76f164f265db68c671533b293c4a475ca91
Handle copying bitmaps to larger data buffers

If a bitmap of a shorter length than the data buffer is passed to
virBitmapToDataBuf, it will read off the end of the bitmap and copy junk
into the returned buffer. Add a check to only copy the length of the
bitmap to the buffer.

The problem can be observed after setting a vcpu affinity using the vcpupin
command on a system with a large number of cores:
  # virsh vcpupin example_domain 0 0
  # virsh vcpupin example_domain 0
     VCPU   CPU Affinity
    ---------------------------
     0      0,192,197-198,202

Signed-off-by: John Allen <john.allen@amd.com>
src/util/virbitmap.c