From nobody Tue Feb 10 12:14:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680084880; cv=none; d=zohomail.com; s=zohoarc; b=Gb2lzssA+YyHuzzI9sdK3KPwvMzc0/MOSTIy2p1IXLdN3PHUWG14h/VkNI7o2amudPDHn7Ui6FrvW+IIU0NsMtn94f+7+6Z8akbbr/brOLLvME4KTpHHc3+xXrKu++Mp/w8sHLVwIl4bzoZwINuOgj7MEatS7QZytXvTFjpO2MY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680084880; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=MT8XLNIfSN+ICnD9hR6EzGYnsTLKJo5n4VXiEpsYn3U=; b=J/PV8f7BwmSKyXfL1o+v9Aw4eNote7wbm89mt00nM+h1zP+Amw8dl3u/8vq2kHBLinEvhNU4b0z7FO8xJgsY6VlNvHQXmfX9emT0qDFvTN8/L4YWMC/MnIVopOtbe0NT6//GQ33QlI9dJMtBoZwRYy4TqwXdtBBEEhRkYtiqay4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680084880986435.17387567136973; Wed, 29 Mar 2023 03:14:40 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-lYM-5244P16KpJUTwVLjmg-1; Wed, 29 Mar 2023 06:14:37 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4CA7D88562A; Wed, 29 Mar 2023 10:14:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 368D240B3ED9; Wed, 29 Mar 2023 10:14:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E8A88194658D; Wed, 29 Mar 2023 10:14:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E8EB8194658C for ; Wed, 29 Mar 2023 10:14:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8CDC4492B02; Wed, 29 Mar 2023 10:14:33 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 860C0492B00 for ; Wed, 29 Mar 2023 10:14:33 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 412623C1178D for ; Wed, 29 Mar 2023 10:14:33 +0000 (UTC) Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-TFlhbX1vOyuBj47qMLW-Hg-1; Wed, 29 Mar 2023 06:14:31 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id C1C26186521C for ; Wed, 29 Mar 2023 13:09:24 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FAjmRI5SIx7x; Wed, 29 Mar 2023 13:09:24 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 543921865217; Wed, 29 Mar 2023 13:09:20 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JCi6UIetXNUU; Wed, 29 Mar 2023 13:09:20 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.58]) by mail.astralinux.ru (Postfix) with ESMTPSA id 1EC3C186522F; Wed, 29 Mar 2023 13:09:12 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680084880; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MT8XLNIfSN+ICnD9hR6EzGYnsTLKJo5n4VXiEpsYn3U=; b=PHa5dEJZMhim62lPm2SHD4lyLzXfXkiBqm3PmZN6kWV4IZokcTkB3QSNC00FJJzSIMXNGO ByOt59648kvQHf8KCKFbfghTXr4KVLhANHviNefiHsGe2tMrq5/D0yDKPNdyCOWdGTgDHm CgNvwCRlvU3FXhTOq8LMY6P3a6tj3Ic= X-MC-Unique: lYM-5244P16KpJUTwVLjmg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: TFlhbX1vOyuBj47qMLW-Hg-1 X-Virus-Scanned: amavisd-new at astralinux.ru From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20=D0=91=D0=B5=D0=BB=D0=BE=D0=B2=D0=B0?= To: libvir-list@redhat.com Subject: [PATCH] storage_file_probe: change maximum len value in vmdk4GetBackingStore Date: Wed, 29 Mar 2023 13:09:02 +0300 Message-Id: <20230329100902.8810-1-abelova@astralinux.ru> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anastasia Belova Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: astralinux.ru Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680084883414100001 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Anastasia Belova desc length should be always less than VIR_STORAGE_MAX_HEADER. If len =3D VIR_STORAGE_MAX_HEADER, desc may be out of bounds. Fixes: 296032bfb2 ("util: extract storage file probe code into virtstoragef= ileprobe.c") Signed-off-by: Anastasia Belova Reviewed-by: J=C3=A1n Tomko --- src/storage_file/storage_file_probe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storage_file/storage_file_probe.c b/src/storage_file/stora= ge_file_probe.c index 9465af5d96..0dcc9c2c54 100644 --- a/src/storage_file/storage_file_probe.c +++ b/src/storage_file/storage_file_probe.c @@ -586,8 +586,8 @@ vmdk4GetBackingStore(char **res, return BACKING_STORE_INVALID; =20 len =3D buf_size - 0x200; - if (len > VIR_STORAGE_MAX_HEADER) - len =3D VIR_STORAGE_MAX_HEADER; + if (len >=3D VIR_STORAGE_MAX_HEADER) + len =3D VIR_STORAGE_MAX_HEADER - 1; memcpy(desc, buf + 0x200, len); desc[len] =3D '\0'; start =3D strstr(desc, prefix); --=20 2.30.2