[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/12] dmg: warn when opening dmg images containing blocks of unkn
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 11/12] dmg: warn when opening dmg images containing blocks of unknown type |
|
Date: |
Sun, 6 Nov 2022 09:51:14 +0100 |
From: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220929093035.4231-5-cfontana@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/dmg.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/block/dmg.c b/block/dmg.c
index ba8ec344d479..675e840ca587 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -254,6 +254,25 @@ static int dmg_read_mish_block(BDRVDMGState *s,
DmgHeaderState *ds,
for (i = s->n_chunks; i < s->n_chunks + chunk_count; i++) {
s->types[i] = buff_read_uint32(buffer, offset);
if (!dmg_is_known_block_type(s->types[i])) {
+ switch (s->types[i]) {
+ case UDBZ:
+ warn_report_once("dmg-bzip2 module is missing, accessing bzip2
"
+ "compressed blocks will result in I/O
errors");
+ break;
+ case ULFO:
+ warn_report_once("dmg-lzfse module is missing, accessing lzfse
"
+ "compressed blocks will result in I/O
errors");
+ break;
+ case UDCM:
+ case UDLE:
+ /* Comments and last entry can be ignored without problems */
+ break;
+ default:
+ warn_report_once("Image contains chunks of unknown type %x, "
+ "accessing them will result in I/O errors",
+ s->types[i]);
+ break;
+ }
chunk_count--;
i--;
offset += 40;
--
2.38.1
- [PULL 01/12] util/main-loop: Fix maximum number of wait objects for win32, (continued)
- [PULL 01/12] util/main-loop: Fix maximum number of wait objects for win32, Paolo Bonzini, 2022/11/06
- [PULL 02/12] util/main-loop: Avoid adding the same HANDLE twice, Paolo Bonzini, 2022/11/06
- [PULL 04/12] gdb-xml: Fix size of EFER register on i386 architecture when debugged by GDB, Paolo Bonzini, 2022/11/06
- [PULL 03/12] util/aio-win32: Correct the event array size in aio_poll(), Paolo Bonzini, 2022/11/06
- [PULL 05/12] Fix broken configure with -Wunused-parameter, Paolo Bonzini, 2022/11/06
- [PULL 06/12] meson: avoid unused arguments of main() in compiler tests, Paolo Bonzini, 2022/11/06
- [PULL 07/12] Add missing include statement for global xml_builtin, Paolo Bonzini, 2022/11/06
- [PULL 08/12] module: removed unused function argument "mayfail", Paolo Bonzini, 2022/11/06
- [PULL 09/12] module: rename module_load_one to module_load, Paolo Bonzini, 2022/11/06
- [PULL 10/12] module: add Error arguments to module_load and module_load_qom, Paolo Bonzini, 2022/11/06
- [PULL 11/12] dmg: warn when opening dmg images containing blocks of unknown type,
Paolo Bonzini <=
- [PULL 12/12] accel: abort if we fail to load the accelerator plugin, Paolo Bonzini, 2022/11/06
- Re: [PULL 00/12] Misc bugfix patches (+ improved module errors) for QEMU 7.2, Stefan Hajnoczi, 2022/11/07