qemu/tests
Kevin Wolf d7e7f342c6 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>
(cherry picked from commit bd385a5298)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-07-03 23:03:02 +03:00
..
avocado tests/avocado: update sunxi kernel from armbian to 6.6.16 2024-05-01 09:01:23 +03:00
bench migration/xbzrle: Use i386 host/cpuinfo.h 2023-05-23 16:51:18 -07:00
data tests/acpi: Update DSDT.cxl to reflect change _STA return value. 2024-02-15 11:29:04 +03:00
decode tests/: spelling fixes 2023-09-08 13:08:52 +03:00
docker tests: Update our CI to use CentOS Stream 9 instead of 8 2024-06-30 15:27:33 +03:00
fp tests: fp: remove unused submodules 2023-06-07 11:05:09 +02:00
guest-debug tests/tcg: clean-up gdb confirm/pagination settings 2023-08-30 14:57:50 +01:00
image-fuzzer image-fuzzer: Use OSerror.strerror instead of tuple subscript 2019-11-05 16:36:11 +01:00
include tests: add missing generated sources to testqapi 2020-10-17 10:45:50 -04:00
keys tests/vm: Add Haiku test based on their vagrant images 2020-11-17 09:45:24 +01:00
lcitool tests: Update our CI to use CentOS Stream 9 instead of 8 2024-06-30 15:27:33 +03:00
migration tests/migration: Introduce dirty-limit into guestperf 2023-11-03 07:48:25 +01:00
multiboot Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
perf/block/qcow2 tests/perf: Test lseek influence on qcow2 block-status 2019-06-04 15:20:41 +02:00
plugin plugins: fix win plugin tests on cross compile 2023-11-23 14:10:04 +00:00
qapi-schema tests/qapi-schema: Tidy up pylint warnings and advice 2023-11-13 10:36:51 +01:00
qemu-iotests qcow2: Don't open data_file with BDRV_O_NO_IO 2024-07-03 23:03:02 +03:00
qtest tests/qtest: Depend on dbus_display1_dep 2024-02-20 19:01:51 +03:00
rocker tests: Avoid non-portable 'echo -ARG' 2017-07-11 17:45:00 +02:00
tcg target/arm: Fix FJCVTZS vs flush-to-zero 2024-07-02 09:49:20 +03:00
tsan tests/tsan: Rename the file with the entries that should be ignored 2023-11-13 11:35:47 +01:00
uefi-test-tools tests/: spelling fixes 2023-09-08 13:08:52 +03:00
unit tests/unit: Bump test-replication timeout to 60 seconds 2024-03-20 17:33:40 +03:00
vm tests: Update our CI to use CentOS Stream 9 instead of 8 2024-06-30 15:27:33 +03:00
vmstate-static-checker-data hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
dbus-vmstate-daemon.sh tests: add dbus-vmstate-test 2020-01-06 18:41:32 +04:00
Makefile.include tests: respect --enable/--disable-download for Avocado 2023-11-24 12:07:47 +01:00
meson.build Makefile: build plugins before running TCG tests 2023-10-02 18:04:39 +02:00
test-qht-par.c
vhost-user-bridge.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00