diff options
author | Kevin Wolf <kwolf@redhat.com> | 2024-04-11 15:06:01 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2024-07-02 18:09:51 +0200 |
commit | bd385a5298d7062668e804d73944d52aec9549f1 (patch) | |
tree | 413d1d8b7504c38c39eea88859c02b96910827dc /scripts/qapi/parser.py | |
parent | c80a339587fe4148292c260716482dd2f86d4476 (diff) | |
download | qemu-bd385a5298d7062668e804d73944d52aec9549f1.zip qemu-bd385a5298d7062668e804d73944d52aec9549f1.tar.gz qemu-bd385a5298d7062668e804d73944d52aec9549f1.tar.bz2 |
qcow2: Don't open data_file with BDRV_O_NO_IO
One use case for 'qemu-img info' is verifying that untrusted images
don't reference an unwanted external file, be it as a backing file or an
external data file. To make sure that calling 'qemu-img info' can't
already have undesired side effects with a malicious image, just don't
open the data file at all with BDRV_O_NO_IO. If nothing ever tries to do
I/O, we don't need to have it open.
This changes the output of iotests case 061, which used 'qemu-img info'
to show that opening an image with an invalid data file fails. After
this patch, it succeeds. Replace this part of the test with a qemu-io
call, but keep the final 'qemu-img info' to show that the invalid data
file is correctly displayed in the output.
Fixes: CVE-2024-4467
Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Diffstat (limited to 'scripts/qapi/parser.py')
0 files changed, 0 insertions, 0 deletions