1. 01 4月, 2014 1 次提交
    • K
      qcow2: Don't rely on free_cluster_index in alloc_refcount_block() (CVE-2014-0147) · b106ad91
      Kevin Wolf 提交于
      free_cluster_index is only correct if update_refcount() was called from
      an allocation function, and even there it's brittle because it's used to
      protect unfinished allocations which still have a refcount of 0 - if it
      moves in the wrong place, the unfinished allocation can be corrupted.
      
      So not using it any more seems to be a good idea. Instead, use the
      first requested cluster to do the calculations. Return -EAGAIN if
      unfinished allocations could become invalid and let the caller restart
      its search for some free clusters.
      
      The context of creating a snapsnot is one situation where
      update_refcount() is called outside of a cluster allocation. For this
      case, the change fixes a buffer overflow if a cluster is referenced in
      an L2 table that cannot be represented by an existing refcount block.
      (new_table[refcount_table_index] was out of bounds)
      
      [Bump the qemu-iotests 026 refblock_alloc.write leak count from 10 to
      11.
      --Stefan]
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      b106ad91
  2. 07 10月, 2013 1 次提交
  3. 06 9月, 2013 1 次提交
    • K
      qemu-iotests: Fixed test case 026 · 8f94b077
      Kevin Wolf 提交于
      The reference output for test case 026 hasn't been updated in a long
      time and it's one of the "known failing" cases. This patch updates the
      reference output so that unintentional changes can be reliably detected
      again.
      
      The problem with this test case is that it produces different output
      depending on whether -nocache is used or not. The solution of this patch
      is to actually have two different reference outputs. If nnn.out.nocache
      exists, it is used as the reference output for -nocache; otherwise,
      nnn.out stays valid for both cases.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      8f94b077
  4. 19 4月, 2012 1 次提交
  5. 22 2月, 2012 2 次提交