From nobody Tue Feb 10 05:45:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1663975667; cv=none; d=zohomail.com; s=zohoarc; b=bOFrdXeHFK5niZWDibqFcfySazkbZ7sS6FYUHZbAG1OVEtn82qmqwDD9VzB1xnKAl51W9HcE9Wh6oJqzR3rmjFAqOcWKyNt/+BKnPaFrMGCAbvgInRrKUnp9ODL+qfZqs2abVeITzsjewz5PrkCPhG8g/pQEMVaSoqJG/8cltps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663975667; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7Iu3+bIbe/hhWK1CJ9RCrzUO/zTt0gE/jDQ4LmWkWpg=; b=ERPJUFqFKog4S3HueOk9yBWK2h7Mb3HGQ8fRU1ZQymJr/XRXrZGLWvIZ2QhD2IlRXuYgo/hnJEAdyq292S/3m8pPQ/5vmfMBcj/ngnWYwn5E5fZu+8hHjzuyN8KwWDCvkX8O1T2D/wrcPced/7AXFunrJxUuE2Np5gAy9l1nuo4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1663975667239337.1814028185962; Fri, 23 Sep 2022 16:27:47 -0700 (PDT) Received: from localhost ([::1]:45270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obs5B-00028h-W0 for importer@patchew.org; Fri, 23 Sep 2022 19:27:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obryy-00026O-HP for qemu-devel@nongnu.org; Fri, 23 Sep 2022 19:21:20 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:57146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obryw-0007LR-AR for qemu-devel@nongnu.org; Fri, 23 Sep 2022 19:21:20 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2ECE721986; Fri, 23 Sep 2022 23:21:17 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CABD313A00; Fri, 23 Sep 2022 23:21:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kH7BL2w/LmPcUwAAMHmgww (envelope-from ); Fri, 23 Sep 2022 23:21:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1663975277; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Iu3+bIbe/hhWK1CJ9RCrzUO/zTt0gE/jDQ4LmWkWpg=; b=VOFA3LqQQKeWM2tCMUSYm2wU6gHJsDjRGuWJJBT/jJXsppNcZKYTdoGIwstMXuBM+Cdtc9 wks+Lrk1gmb2db/58Sew+FCs53hFhm65uSAtOLvBahfW4saf3DJT8R2tHrcj9B+bgucMln nU/kBMVpISZRt7gJh3GbP+g2OLVBA4U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1663975277; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Iu3+bIbe/hhWK1CJ9RCrzUO/zTt0gE/jDQ4LmWkWpg=; b=e34HrwraWJ4oeE1KkzlvUhzZTpiOaazn38my+Ta87DVSyg5rNGyn7gEtxElMbcEA/Kax61 nlajIgeCdAkXRvDg== From: Claudio Fontana To: Paolo Bonzini , Richard Henderson , Markus Armbruster , Kevin Wolf Cc: qemu-devel@nongnu.org, dinechin@redhat.com, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , 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 Message-Id: <20220923232104.28420-5-cfontana@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220923232104.28420-1-cfontana@suse.de> References: <20220923232104.28420-1-cfontana@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.220.28; envelope-from=cfontana@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1663975667660100001 Content-Type: text/plain; charset="utf-8" From: Kevin Wolf Signed-off-by: Claudio Fontana --- 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, DmgHea= derState *ds, for (i =3D s->n_chunks; i < s->n_chunks + chunk_count; i++) { s->types[i] =3D 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 b= zip2 " + "compressed blocks will result in I/O err= ors"); + break; + case ULFO: + warn_report_once("dmg-lzfse module is missing, accessing l= zfse " + "compressed blocks will result in I/O err= ors"); + 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 +=3D 40; --=20 2.26.2