[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 4/5] dmg: warn when opening dmg images containing blocks of un
From: |
Claudio Fontana |
Subject: |
[PATCH v6 4/5] dmg: warn when opening dmg images containing blocks of unknown type |
Date: |
Sat, 24 Sep 2022 01:21:03 +0200 |
From: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
block/dmg.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/block/dmg.c b/block/dmg.c
index a422cf8d5b..f54f1d99d4 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.26.2
- [PATCH v6 0/5] improve error handling for module load, Claudio Fontana, 2022/09/23
- [PATCH v6 2/5] module: rename module_load_one to module_load, Claudio Fontana, 2022/09/23
- [PATCH v6 4/5] dmg: warn when opening dmg images containing blocks of unknown type,
Claudio Fontana <=
- [PATCH v6 1/5] module: removed unused function argument "mayfail", Claudio Fontana, 2022/09/23
- [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Claudio Fontana, 2022/09/23
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Kevin Wolf, 2022/09/26
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Claudio Fontana, 2022/09/26
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Claudio Fontana, 2022/09/26
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Markus Armbruster, 2022/09/27
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Claudio Fontana, 2022/09/27
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Kevin Wolf, 2022/09/27
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Claudio Fontana, 2022/09/27
- Re: [PATCH v6 3/5] module: add Error arguments to module_load and module_load_qom, Kevin Wolf, 2022/09/27