aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2019-02-08 17:44:53 +0200
committerKevin Wolf <kwolf@redhat.com>2019-02-25 15:05:23 +0100
commitc1c43990846b89d740487d7022dce9415453f344 (patch)
treedd0b4d81580b177d2d4a5371a75ae8fdf3afe5bc /hw
parent2dbfadf60654ea5eecd5df77babaa92831954a98 (diff)
downloadqemu-c1c43990846b89d740487d7022dce9415453f344.zip
qemu-c1c43990846b89d740487d7022dce9415453f344.tar.gz
qemu-c1c43990846b89d740487d7022dce9415453f344.tar.bz2
qcow2: Assert that L2 table offsets fit in the L1 table
L1 table entries have a field to store the offset of an L2 table. The rest of the bits of the entry are currently reserved except from bit 63, which stores the COPIED flag. The offset is always taken from the entry using L1E_OFFSET_MASK to ensure that we only use the bits that belong to that field. While that mask is used every time we read from the L1 table, it is never used when we write to it. Due to the limits set elsewhere in the code QEMU can never produce L2 table offsets that don't fit in that field so any such offset when allocating an L2 table would indicate a bug in QEMU. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
0 files changed, 0 insertions, 0 deletions