mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qcow2: Validate refcount table offset
The end of the refcount table must not exceed INT64_MAX so that integer overflows are avoided. Also check for misaligned refcount table. Such images are invalid and probably the result of data corruption. Error out to avoid further corruption. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
5dab2faddc
commit
8c7de28305
3 changed files with 56 additions and 0 deletions
|
@ -20,4 +20,14 @@ qemu-io: can't open device TEST_DIR/t.qcow2: Reference count table too large
|
|||
no file open, try 'help open'
|
||||
qemu-io: can't open device TEST_DIR/t.qcow2: Reference count table too large
|
||||
no file open, try 'help open'
|
||||
|
||||
== Misaligned refcount table ==
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
|
||||
qemu-io: can't open device TEST_DIR/t.qcow2: Invalid reference count table offset
|
||||
no file open, try 'help open'
|
||||
|
||||
== Huge refcount offset ==
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
|
||||
qemu-io: can't open device TEST_DIR/t.qcow2: Invalid reference count table offset
|
||||
no file open, try 'help open'
|
||||
*** done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue