Bug 598407 - qcow2 corruption bug in refcount table growth
qcow2 corruption bug in refcount table growth
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
All Linux
low Severity high
: rc
: ---
Assigned To: Kevin Wolf
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-01 06:48 EDT by Kevin Wolf
Modified: 2013-01-09 17:39 EST (History)
4 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.75.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 598488 (view as bug list)
Environment:
Last Closed: 2010-07-02 03:21:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kevin Wolf 2010-06-01 06:48:30 EDT
A bug in rarely used code path in the refcount table growth code of qcow2 can lead to inconsistencies in the metadata, which can cause real data corruption later on.

This bug can be reproduced like this:

[rhel6/master] kwolf@dhcp-5-188:~/source/qemu-kvm-rhel6$ ./qemu-img create -f qcow2 -ocluster_size=512 /tmp/test.qcow2 1G
Formatting '/tmp/test.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=512 
[rhel6/master] kwolf@dhcp-5-188:~/source/qemu-kvm-rhel6$ ./qemu-io /tmp/test.qcow2 
qemu-io> write -b 0 64M
wrote 67108864/67108864 bytes at offset 0
64 MiB, 1 ops; 0:00:11.00 (5.791 MiB/sec and 0.0905 ops/sec)
qemu-io> [rhel6/master] kwolf@dhcp-5-188:~/source/qemu-kvm-rhel6$ ./qemu-img check /tmp/test.qcow2 
ERROR cluster 768 refcount=0 reference=1
ERROR cluster 773 refcount=2 reference=1
ERROR cluster 774 refcount=2 reference=1
ERROR cluster 1024 refcount=0 reference=1
ERROR cluster 1029 refcount=2 reference=1
ERROR cluster 1030 refcount=2 reference=1
ERROR cluster 1031 refcount=2 reference=1
7 errors were found on the image.
Comment 4 Qunfang Zhang 2010-06-17 06:10:28 EDT
Can reproduce the issue on qemu-kvm-0.12.1.2-2.73.el6, and verified pass on qemu-kvm-0.12.1.2-2.75.el6 with the given steps.
Comment 6 Qunfang Zhang 2010-07-02 03:20:32 EDT
Close it according to Comment 4.

Note You need to log in before you can comment on or make changes to this bug.