1. 14 7月, 2014 5 次提交
    • S
      virtio-blk: avoid dataplane VirtIOBlockReq early free · 0a21ea32
      Stefan Hajnoczi 提交于
      VirtIOBlockReq is freed later by virtio_blk_free_request() in
      hw/block/virtio-blk.c.  Remove this extraneous g_slice_free().
      
      This patch fixes the following segfault:
      
        0x00005555556373af in virtio_blk_rw_complete (opaque=0x5555565ff5e0, ret=0) at hw/block/virtio-blk.c:99
        99          bdrv_acct_done(req->dev->bs, &req->acct);
        (gdb) print req
        $1 = (VirtIOBlockReq *) 0x5555565ff5e0
        (gdb) print req->dev
        $2 = (VirtIOBlock *) 0x0
        (gdb) bt
        #0  0x00005555556373af in virtio_blk_rw_complete (opaque=0x5555565ff5e0, ret=0) at hw/block/virtio-blk.c:99
        #1  0x0000555555840ebe in bdrv_co_em_bh (opaque=0x5555566152d0) at block.c:4675
        #2  0x000055555583de77 in aio_bh_poll (ctx=ctx@entry=0x5555563a8150) at async.c:81
        #3  0x000055555584b7a7 in aio_poll (ctx=0x5555563a8150, blocking=blocking@entry=true) at aio-posix.c:188
        #4  0x00005555556e520e in iothread_run (opaque=0x5555563a7fd8) at iothread.c:41
        #5  0x00007ffff42ba124 in start_thread () from /usr/lib/libpthread.so.0
        #6  0x00007ffff16d14bd in clone () from /usr/lib/libc.so.6
      Reported-by: NMax Reitz <mreitz@redhat.com>
      Cc: Fam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Tested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0a21ea32
    • K
      block: Assert qiov length matches request length · 8eb029c2
      Kevin Wolf 提交于
      At least raw-posix relies on this because it can allocate bounce buffers
      based on the request length, but access it using all of the qiov entries
      later.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      8eb029c2
    • K
      qed: Make qiov match request size until backing file EOF · f06ee3d4
      Kevin Wolf 提交于
      If a QED image has a shorter backing file and a read request to
      unallocated clusters goes across EOF of the backing file, the backing
      file sees a shortened request and the rest is filled with zeros.
      However, the original too long qiov was used with the shortened request.
      
      This patch makes the qiov size match the request size, avoiding a
      potential buffer overflow in raw-posix.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      f06ee3d4
    • K
      qcow2: Make qiov match request size until backing file EOF · 44deba5a
      Kevin Wolf 提交于
      If a qcow2 image has a shorter backing file and a read request to
      unallocated clusters goes across EOF of the backing file, the backing
      file sees a shortened request and the rest is filled with zeros.
      However, the original too long qiov was used with the shortened request.
      
      This patch makes the qiov size match the request size, avoiding a
      potential buffer overflow in raw-posix.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      44deba5a
    • K
      block: Make qiov match the request size until EOF · 33f461e0
      Kevin Wolf 提交于
      If a read request goes across EOF, the block driver sees a shortened
      request that stops at EOF (the rest is memsetted in block.c), however
      the original qiov was used for this request.
      
      This patch makes the qiov size match the request size, avoiding a
      potential buffer overflow in raw-posix.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      33f461e0
  2. 09 7月, 2014 6 次提交
  3. 08 7月, 2014 20 次提交
  4. 07 7月, 2014 9 次提交