From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 60974D810CD for ; Tue, 24 Oct 2023 12:02:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RxwMFcDVwxr9Vfo/NjmYzWlCqHqhv6b7dTEbSf3XBOw=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1698148961; v=1; b=ukgkCxK9zJPHQSTzgnGO7Y71paW961ZENEoEuw1ACUISHp8wa3GtVpJx2PtQbq2hH9c7i5oe knVRHTYQlbpNvRsk20BbIwqtgx251eGM5VMrBnmfkVpMEM+e3QRZBgvRG3nR4yDrxl+OnyZqQ3D wAjIgzibgrFxvOKG8YodxQgo= X-Received: by 127.0.0.2 with SMTP id fE6NYY7687511xFGV711cWvA; Tue, 24 Oct 2023 05:02:41 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.16255.1698148960425003956 for ; Tue, 24 Oct 2023 05:02:40 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-G0YLC1-cMriFXNoA6m5pQw-1; Tue, 24 Oct 2023 08:02:38 -0400 X-MC-Unique: G0YLC1-cMriFXNoA6m5pQw-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC21788CC46; Tue, 24 Oct 2023 12:02:37 +0000 (UTC) X-Received: from [10.39.195.39] (unknown [10.39.195.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 943061121320; Tue, 24 Oct 2023 12:02:36 +0000 (UTC) Message-ID: <74942487-4eca-6414-b3a2-60eff1195301@redhat.com> Date: Tue, 24 Oct 2023 14:02:35 +0200 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 1/1] StandaloneMmPkg: Fix the failure to find uncompressed inner FV. To: devel@edk2.groups.io, wei6.xu@intel.com Cc: Ard Biesheuvel , Sami Mujawar , Ray Ni References: From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: EdTy6LbpG3Me9f6h0mGMTVzsx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ukgkCxK9; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 10/24/23 07:53, Xu, Wei6 wrote: > The MmCoreFfsFindMmDriver only checks for encapsulated compressed FVs. > When an inner FV is uncompressed, StandaloneMmCore will miss the FV and > all the MM drivers in the FV will not be dispatched. > Add checks for uncompressed inner FV to fix this issue. >=20 > Cc: Ard Biesheuvel > Cc: Sami Mujawar > Cc: Ray Ni > Signed-off-by: Wei6 Xu > --- > StandaloneMmPkg/Core/FwVol.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVol.c > index 1f6d7714ba97..1a85d80eb9f7 100644 > --- a/StandaloneMmPkg/Core/FwVol.c > +++ b/StandaloneMmPkg/Core/FwVol.c > @@ -104,6 +104,17 @@ MmCoreFfsFindMmDriver ( > break; > } > =20 > + Status =3D FfsFindSectionData ( > + EFI_SECTION_FIRMWARE_VOLUME_IMAGE, > + FileHeader, > + &SectionData, > + &SectionDataSize > + ); > + if (!EFI_ERROR (Status)) { > + InnerFvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)SectionData; > + MmCoreFfsFindMmDriver (InnerFvHeader); > + } > + > Status =3D FfsFindSectionData ( > EFI_SECTION_GUID_DEFINED, > FileHeader, I'd recommend fixing other, more foundational issues first, in this function, such as: - memory leaks on error paths - unbounded recursion - missing object size checks before casting pointers to header types At the same time I agree that this change doesn't seem to make things worse than they are. Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109998): https://edk2.groups.io/g/devel/message/109998 Mute This Topic: https://groups.io/mt/102152694/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-