From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web09.4370.1616585517698096752 for ; Wed, 24 Mar 2021 04:31:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hPPDLUvC; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616585516; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=QAA4rM9PRppDrBedliRm3XdFVNtzT43Q1LpqVYxk27g=; b=hPPDLUvCq2RaWebESAfi86Y4R8xRDdvLtawgSXKLUcEMWx1/xLK4xxWKWoMYw/io8cAjud HAZoV7vk8F8fZvxDA/wmDrib+ZQV6cHODoYjN1PQQ/m/oO5d0HUHRq4o3/mtMD/sUARRc9 f6OouQ3XIfQnxZrwz1or4c5AqICApqI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-ZP3ecVtSNXWxbdl1hj2sWA-1; Wed, 24 Mar 2021 07:31:52 -0400 X-MC-Unique: ZP3ecVtSNXWxbdl1hj2sWA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1AB08030B5; Wed, 24 Mar 2021 11:31:51 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-138.ams2.redhat.com [10.36.115.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FC2D5D9DE; Wed, 24 Mar 2021 11:31:50 +0000 (UTC) Subject: Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: Allow BMP with extra data To: devel@edk2.groups.io, bret.barkelew@microsoft.com, "jbrasen@nvidia.com" Cc: "jian.j.wang@intel.com" , "ao.a.wu@intel.com" References: <70c26f78d461d1b8021462d3c3fe6eb717b19193.1616520420.git.jbrasen@nvidia.com> From: "Laszlo Ersek" Message-ID: Date: Wed, 24 Mar 2021 12:31:49 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit On 03/23/21 18:41, Bret Barkelew via groups.io wrote: > Is this a *good* idea? > > What is considered valid extra data? If it’s immaterial to the FW displaying the image, our policy has been to strip it off BEFORE adding it to the FW image. Not counting any potential security aspects, stripping out undisplayed portions helps with flash usage too (I think?), so at least some concrete justification in the commit message would be nice... Thanks Laszlo > > - Bret > > From: Jeff Brasen via groups.io > Sent: Tuesday, March 23, 2021 10:29 AM > To: devel@edk2.groups.io > Cc: jian.j.wang@intel.com; ao.a.wu@intel.com; Jeff Brasen > Subject: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: Allow BMP with extra data > > Add support for processing BMP data that contains extra data after the > image array, this data will not be parsed in anyway in the library but > images that contain this will not be rejected from processing. > > --- > MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c > index 3ac31f6723d0..944d01fe7cdf 100644 > --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c > +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c > @@ -213,7 +213,7 @@ TranslateBmpToGopBlt ( > > if ((BmpHeader->Size != BmpImageSize) || > (BmpHeader->Size < BmpHeader->ImageOffset) || > - (BmpHeader->Size - BmpHeader->ImageOffset != DataSize)) { > + (BmpHeader->Size - BmpHeader->ImageOffset < DataSize)) { > > DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... \n")); > DEBUG ((DEBUG_ERROR, " BmpHeader->Size: 0x%x\n", BmpHeader->Size)); > -- > 2.25.1 > > > > > > > > > > > >