New issue
Advanced search Search tips

Issue 874699 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Aug 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

crosvm qcow2 module interprets compressed cluster flag incorrectly

Project Member Reported by dverkamp@chromium.org, Aug 16

Issue description

The qcow.rs qcow2 read support attempts to fail read requests for compressed clusters (since compression support is not implemented), but it is checking for the compressed flag on the L1 table entry, rather than the cluster descriptor (L2 table entry) where it is stored according to the qcow2 documentation.

This is a simple fix (check against the right variable), but we should probably also add a test for it, which is a little more complicated to put together without write support for compression.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/285b682d74f3d1528897e5da6d6be9165c3e6914

commit 285b682d74f3d1528897e5da6d6be9165c3e6914
Author: Daniel Verkamp <dverkamp@chromium.org>
Date: Fri Aug 17 18:18:12 2018

qcow: fix check for compressed cluster bit

The bit that indicates a compressed cluster in the qcow2 format is
stored in the L2 table entry (cluster descriptor), but the code was
checking for it in the L1 table entry.

Spotted by inspection based on the qcow2 format documentation (QEMU
docs/interop/qcow2.txt).

This has no impact in normal crosvm use cases, since crosvm never writes
compressed clusters; the only case where it could have any effect would
be when using a QEMU-created qcow2 image with compressed clusters, which
would have returned incorrect data from a read instead of failing the
read request as intended.

BUG= chromium:874699 

Change-Id: Ic247490dcac5440fab8e4d34d24ffe6fe9ab3110
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1176733
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/285b682d74f3d1528897e5da6d6be9165c3e6914/qcow/src/qcow.rs

Status: Verified (was: Started)

Sign in to add a comment