qcow2 corruption
Bug #361938 reported by
Dustin Kirkland
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kvm (Ubuntu) |
Fix Released
|
Critical
|
Dustin Kirkland | ||
Jaunty |
Fix Released
|
Critical
|
Dustin Kirkland |
Bug Description
Binary package hint: kvm
A serious qcow2 corruption issue was fixed upstream. We should proactively carry this patch in Ubuntu.
:-Dustin
Related branches
To post a comment you must log in.
http:// git.kernel. org/?p= virt/kvm/ kvm-userspace. git;a=commitdif f;h=385aae33c08 e17ec63671b9fa1 c503c21283bc1f; hp=b335c2b57622 59c827bae487dca 26441497a96cb
qcow2's get_cluster_ offset( ) scans forward in the l2 table to find other allocated( ).
clusters that have the same allocation status as the first cluster.
This is used by (among others) qcow_is_
Unfortunately, it was not checking to be sure that it didn't fall off
the end of the l2 table. This patch adds that check.
The symptom that motivated me to look into this was that
bdrv_is_allocated() was returning false when there was in fact data
there. This is one of many ways this bug could lead to data corruption.
I checked the other place that scans for consecutive unallocated blocks cluster_ offset( )) and it appears to be OK:
(alloc_
nb_clusters = MIN(nb_clusters, s->l2_size - l2_index);
appears to prevent the same problem from occurring.
Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
Signed-off-by: Anthony Liguori <email address hidden>