From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on072a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::72a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1E34E1A1E56 for ; Wed, 19 Oct 2016 16:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8L1U7HfsjCcE8AVFlb6zwX5kJ13Ev4AmV2FYSMdFnaY=; b=i63IMNRNYgbrZqQHxkl+qTKJHHYkw06vDqZblm82CCehpHigu5KArzdlFJwO30sRPwTC7tMv1tC+eZAaGqVH62o4jl2kJCXIZBKD1dxMrFWX05apXLth41XQJXW6l0BjmolbuqPp1kQXy4mjBOY/vOTXp31Jd/qeMGBha7ZxKWE= Received: from BY1PR03MB1355.namprd03.prod.outlook.com (10.162.109.25) by BY1PR03MB1353.namprd03.prod.outlook.com (10.162.109.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Wed, 19 Oct 2016 23:59:46 +0000 Received: from BY1PR03MB1355.namprd03.prod.outlook.com ([10.162.109.25]) by BY1PR03MB1355.namprd03.prod.outlook.com ([10.162.109.25]) with mapi id 15.01.0659.025; Wed, 19 Oct 2016 23:59:46 +0000 From: Sean Brogan To: "afish@apple.com" CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] question about a compressed Ffs3 file inside FFS2 filesystem Thread-Index: AQHSKmIR3Ib+T7G+fUy92J4E5cAPt6Cwb+iw Date: Wed, 19 Oct 2016 23:59:46 +0000 Message-ID: References: <35C6824F-AF9E-45D2-B380-17E9547411F1@apple.com> In-Reply-To: <35C6824F-AF9E-45D2-B380-17E9547411F1@apple.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sean.brogan@microsoft.com; x-originating-ip: [2001:4898:80e8:b::73e] x-ms-office365-filtering-correlation-id: 4ab83227-a79d-440f-7ad2-08d3f87c013d x-microsoft-exchange-diagnostics: 1; BY1PR03MB1353; 7:1vgGNv/oRW4pN616+7dfrPlOLVWaQTuHPT7Xbt+FiDM3mFiBBsq9Ahvc5EX2ZaVNTExiF/O8I07++Fkul0EkwOVT+PE0nHA5VVI1UvQ9rRxQ7/ICqRDkvhTtNWl0OwBRB5jDMwQ/NbdP19/JlXyksAOKywvMOBMW9ie35jIPPJ+ipBHxY6ENgpuOkljsVPcsF2Q20SGkF25TsiO1Bv/Hw2vqEPrD3y8DHea5ZeO6J33a+NclaEsBJDkhvwNP1pd6XDvWPWlR52xCqXT7KEww4GBN67IkC7uxJsS+vmjyGmluN/WgfuWH/7/1H3mzM58uezk4wYPBM1xO6rILOLEk6Gm8OYFVvdlvZNDr+9m1qv1UqT5CdcpCUXyqEx7tWCtC x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1353; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(166708455590820)(162533806227266)(31960201722614)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(61426038)(61427038); SRVR:BY1PR03MB1353; BCL:0; PCL:0; RULEID:; SRVR:BY1PR03MB1353; x-forefront-prvs: 0100732B76 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(24454002)(377454003)(189002)(13464003)(106356001)(74316002)(106116001)(8676002)(5640700001)(101416001)(110136003)(189998001)(86612001)(1730700003)(11100500001)(15975445007)(68736007)(86362001)(19580395003)(575784001)(19580405001)(6116002)(81156014)(305945005)(102836003)(81166006)(5660300001)(9686002)(586003)(5002640100001)(54356999)(7846002)(92566002)(76176999)(6916009)(10090500001)(7696004)(2900100001)(8936002)(2950100002)(87936001)(33656002)(76576001)(97736004)(105586002)(2351001)(99286002)(8990500004)(5005710100001)(7736002)(10290500002)(8666005)(10400500002)(2906002)(77096005)(4326007)(2501003)(3660700001)(3280700002)(122556002)(50986999)(7059030)(3826002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR03MB1353; H:BY1PR03MB1355.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2016 23:59:46.6718 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1353 Subject: Re: question about a compressed Ffs3 file inside FFS2 filesystem X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 23:59:49 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes. I think the challenge in the code is the compressed section is a guide= d section and the decompression is all handled transparently. =20 One solution might be that once a section was processed that had attributes= of EFI_GUIDED_SECTION_PROCESSING_REQUIRED then the check for filesystems s= hould no longer be performed. =20 Thanks Sean > -----Original Message----- > From: afish@apple.com [mailto:afish@apple.com] > Sent: Wednesday, October 19, 2016 4:40 PM > To: Sean Brogan > Cc: edk2-devel@lists.01.org > Subject: Re: [edk2] question about a compressed Ffs3 file inside FFS2 > filesystem >=20 >=20 > > On Oct 19, 2016, at 4:09 PM, Sean Brogan > wrote: > > > > We have a condition that occurs when we boot where we see the following > message and our boot fails because of it. > > DEBUG ((EFI_D_ERROR, "Found a FFS3 formatted section in a non-FFS3 > > formatted FV.\n")); > > > > Which is on line 773 of FwVol.c ( > > > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Pei/ > Fw > > Vol/FwVol.c ) > > > > The condition is caused by a large firmware volume (greater than 16mb) > that is compressed and put into a smaller FV (less than 16mb). My questi= on > is why isn't this allowed (seems like a valid scenario). Volinfo support= s this > and decodes binary fine. The PI Vol 3 spec has a section 3.2.2 > EFI_FIRMWARE_FILE_SYSTEM3_GUID which says FileSystem2 doesn't > support large files but it seems that the code is not taking into account= that > the section is compressed and therefore you can have a large file inside = a > compressed section inside a FV with File System2. > > > > Feedback/thoughts/comments/Bug? > > >=20 > Sean, >=20 > If I understand correctly you are stating that the contents of an Encapsu= lation > section should not have any restrictions on content type. The only error > checking should be that the raw encapsulation section data needs to fit i= nto > the file type. That seems reasonable to me? I'm not sure if the PI spec m= akes > some statement that the code is enforcing, or I guess the PI spec could b= e > vague and people are interpreting it differently. >=20 > Thanks, >=20 > Andrew Fish >=20 > > Here are some details of my scenario. > > Compressed FV has filesystem =3D=3D 8c8ce578-8a3d-4f1c-9935-896185c32dd= 3 > > (ffs3) Non compressed FV has filesystem =3D=3D > > 5473c07a-3dcb-4dca-bd6f-1e9689e7349a (ffs2) > > > > VolInfo dump of the Non Compressed FV showing the nested/compressed > FV inside. > > > > Decoding > > VolInfo Version 1.0 Build Build 20909 > > Signature: _FVH (4856465F) > > Attributes: 4FEFF > > EFI_FVB2_READ_DISABLED_CAP > > EFI_FVB2_READ_ENABLED_CAP > > EFI_FVB2_READ_STATUS > > EFI_FVB2_WRITE_DISABLED_CAP > > EFI_FVB2_WRITE_ENABLED_CAP > > EFI_FVB2_WRITE_STATUS > > EFI_FVB2_LOCK_CAP > > EFI_FVB2_LOCK_STATUS > > EFI_FVB2_STICKY_WRITE > > EFI_FVB2_MEMORY_MAPPED > > EFI_FVB2_ERASE_POLARITY > > EFI_FVB2_READ_LOCK_CAP > > EFI_FVB2_READ_LOCK_STATUS > > EFI_FVB2_WRITE_LOCK_CAP > > EFI_FVB2_WRITE_LOCK_STATUS > > EFI_FVB2_ALIGNMENT_16 > > EFI_FVB2_ALIGNMENT_32 > > EFI_FVB2_ALIGNMENT_64 > > EFI_FVB2_ALIGNMENT_128 > > EFI_FVB2_ALIGNMENT_4K > > EFI_FVB2_ALIGNMENT_8K > > EFI_FVB2_ALIGNMENT_16K > > EFI_FVB2_ALIGNMENT_32K > > EFI_FVB2_ALIGNMENT_1M > > EFI_FVB2_ALIGNMENT_2M > > EFI_FVB2_ALIGNMENT_4M > > EFI_FVB2_ALIGNMENT_8M > > EFI_FVB2_ALIGNMENT_256M > > EFI_FVB2_ALIGNMENT_512M > > EFI_FVB2_ALIGNMENT_1G > > EFI_FVB2_ALIGNMENT_2G > > Header Length: 0x00000048 > > File System ID: 5473c07a-3dcb-4dca-bd6f-1e9689e7349a > > Revision: 0x0002 > > Number of Blocks: 0x00000028 > > Block Length: 0x00010000 > > Total Volume Size: 0x00280000 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D > > File Name: 9E21FD93-9C72-4C15-8C4B-E77F1DB2D792 > > File Offset: 0x00000048 > > File Length: 0x001F3FFD > > File Attributes: 0x00 > > File State: 0xF8 > > EFI_FILE_DATA_VALID > > File Type: 0x0B EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE > > ------------------------------------------------------------ > > Type: EFI_SECTION_GUID_DEFINED > > Size: 0x001F3FE5 > > SectionDefinitionGuid: ee4e5898-3914-4259-9d6e-dc7bd79403cf > > > > DataOffset: 0x0018 > > Attributes: 0x0001 > > ------------------------------------------------------------ > > Type: EFI_SECTION_RAW > > Size: 0x00000FF8 > > ------------------------------------------------------------ > > Type: EFI_SECTION_FIRMWARE_VOLUME_IMAGE > > Size: 0x01010008 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D > > > > Thanks > > Sean > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel