From nobody Tue Nov 26 03:32:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+58947+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58947+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589007642229496.6918730190048; Sat, 9 May 2020 00:00:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id w6mDYY1788612xo4kbvBf9iC; Sat, 09 May 2020 00:00:41 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.5933.1589007641000683522 for ; Sat, 09 May 2020 00:00:41 -0700 IronPort-SDR: MHveagt41KDs+bugbWtQwPcsoExoSGt+W5/cRnd5lNmh7CuQJ1vTU9xJcZnaUYhIEassSsEedW hUt8h+BTVgAw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2020 00:00:40 -0700 IronPort-SDR: g7ddNsOwY7AnSLzgt0dinRUKKqRoJciQC/GIbZ7vp/dC+xZ6SYtxx0J26pNHW5NQg0IHIZg5Zo ZKzZ59tOLveg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,370,1583222400"; d="scan'208";a="462544769" X-Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by fmsmga005.fm.intel.com with ESMTP; 09 May 2020 00:00:40 -0700 X-Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 9 May 2020 00:00:40 -0700 X-Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 9 May 2020 00:00:39 -0700 X-Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sat, 9 May 2020 00:00:39 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 9 May 2020 00:00:39 -0700 X-Received: from BN8PR11MB3793.namprd11.prod.outlook.com (2603:10b6:408:86::23) by BN8PR11MB3665.namprd11.prod.outlook.com (2603:10b6:408:91::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Sat, 9 May 2020 07:00:37 +0000 X-Received: from BN8PR11MB3793.namprd11.prod.outlook.com ([fe80::6455:7f80:a3b2:730b]) by BN8PR11MB3793.namprd11.prod.outlook.com ([fe80::6455:7f80:a3b2:730b%5]) with mapi id 15.20.2979.033; Sat, 9 May 2020 07:00:37 +0000 From: "Feng, YunhuaX" To: "devel@edk2.groups.io" CC: "Ni, Ray" , "Gao, Liming" , "Feng, Bob C" Subject: [edk2-devel] [PATCH] BaseTools/Fmmt: Fix found the next FFS issue Thread-Topic: [PATCH] BaseTools/Fmmt: Fix found the next FFS issue Thread-Index: AdYlz4lL8B7hu+H4QOSGw1zwvPIU4g== Date: Sat, 9 May 2020 07:00:36 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2265eb28-1406-42d9-a4c5-08d7f3e6ad6a x-ms-traffictypediagnostic: BN8PR11MB3665: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3631; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: VLMWpenXyyj6xqRnH2JP8gp5QrFIn9L/t1qy4Gnda7ZafeVmmOd9bGPWI5+d0jZNonQspr/J4wcH49FE7404B9QwMmgHYd++MW9z+bEyWlG6Qw8Bcql1Lb3upmfY7thy0Ou//moYVCm6vB27saPXtmUQRPgUXo9de5NUnUNdUwthhRtJJZ/A7+fU8DrfGQ66IkF/VIYRC6x7gsLdZ2TZI7GZjV30PBzlz+7/aIp/3ca4trXeya6ebptc56v3jqbo//37nJjfHoSGGRxBhkinRecIwaAlOFVkpSqHWqNVapmXySlzH++8MYEIoXgG/4dxsiuJcAXiwnJiletg/L0lL5ujkJFXIuM3/nOIxZdVsHF7iTJlcUjFHq+DZtZDVC2ERRmWXquaemxFUDNQTdn9jUP85vMxJSY1DcQ2FxqRORFn72dABvkePuzN5RIlnSzhito3wl4nVy3MB9xDRzIdbl5L0v+COjHYVn9gnBlwbmTBxw5uSTh7qnc8L+DQJcy8uIqvgx1eXEKNT1oibNmWwg== x-ms-exchange-antispam-messagedata: 3wLwpgKhPUda8lF5ADXEZLpnrxNUOQgVX8qhZLu6yezhkLfcujbn6boP4DPBavvTOT7otsMHmxHu/HnwnWcFQ8axVXXXnnRQtAdxMFMPon+hh0POnBMEE+ZXO/2xZ6UJp/2q9bTL9IkigQVB+SVsnTp9ksG87xLfG95hCYkVZU5uQl1KLYa2SksdqKhR3BGmv3sQYFYHpFyWIo2+Os1CBjzWtD/4gP17hdP0rdQtlx01mdY8J3nuGH/02wcgOpEOfQ0A+/HR2yfk1ucQIo48cnf6mkPHWDAOFKwjgJxNMvAK6naBnmHzKFN+6RE9vJqOxekcAovoXJ2XPcwQOoobu4ENZ9VDyfUTVn2/ePcElvopw13xOat0QE9d1yPJ37fbVaVDjOKqk630lWNbTGzqIZQwbZ1qqinoYxPmyLBId+4bDUB4V43rP8w8eU8LA/ig3EztJccdEc8qHlrGMk1+9yaBQF2WTTKX26WvZAj1fR0wfEPiGuqw09KqXAqt1Dml arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LYnCdgbHr5/I5LiSX7hK9Paydzoz5S3mY9+yJCUHBHWqbHexGETiBdVGmWGX8kA4moHRVrBrA9+aF/XUChTH61B8eL/sDDsD3Dh48JAuojGTKxte7lqweJl11gqo3Mcx3ZHvZRae8Bexq5u91NlWntHiAc8xblXij4QlFDfIzx2R4vtt5zRh1aSgTO8ooh2u5ek+XPxMBee5eCm88HIObTbmgTABaPkEWNaBfsjwry4oMElnnTMi+b19g9Oco9LiGVjrSV6XJPvj/06MaKVZ2CRsiNWRxOJateh/9kmg8ghxna4UTO/c6TraKQAVaPcJ2SRBEpByjF1me/6CvEFZyA== arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nJAQFvDCoMVeU97rtTH6eSBRRPF/zvtVy5ll0vVxt/0=; b=OaxTzEyQuSbVyb1zaPo9GWko2cL822t0erm9wHm7W4sUZ8TSbHT1LBLs6QwuWfsMfLpD/BNKZoyzROVbnJYNGJlLOdnchR7rixcpni5U0ejdc6n/s1TWi0BBE5qX4hCCvGe1f1QUAIC9uwmr1EMdCmKxjvSrhdUWYwdBK8CK6mFh15SAbEX/amd+gRAhoNtDdWCY0EfFY6u1ikdmhjGUIt4UmNNcwC1CE2c02Qyp831ypBjV9SVg+c2xBcJ4hXFFA8Dj/ouuBQa/cb0c2VnFn6zq9oJyZrDeD9H+pFSAdm+0KXn44p1Yp7pfn2S/3y75dRq4GkTi09w480rLVXMXmg== arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none x-ms-exchange-crosstenant-network-message-id: 2265eb28-1406-42d9-a4c5-08d7f3e6ad6a x-ms-exchange-crosstenant-originalarrivaltime: 09 May 2020 07:00:36.9322 (UTC) x-ms-exchange-crosstenant-fromentityheader: Hosted x-ms-exchange-crosstenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d x-ms-exchange-crosstenant-mailboxtype: HOSTED x-ms-exchange-crosstenant-userprincipalname: SmqFqUGBJeLziOHJZREDOxYc6FoKy958rFxHkD94BOZ1XN3eT1VLHPSsfmqSeZUKTxSm7x67K/9QDgjD+ar/6A== x-ms-exchange-transport-crosstenantheadersstamped: BN8PR11MB3665 MIME-Version: 1.0 X-OriginatorOrg: intel.com Precedence: Bulk List-Unsubscribe: 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,yunhuax.feng@intel.com X-Gm-Message-State: Yo6VbRuxloh0syOTR6Ce3Jm4x1787277AA= Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589007641; bh=mheXd69/tgVJpM2cZ1hKEOKvxXKmaEIPfZBnHPMmQ4M=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=f2Fl88J5VuFxM30E9AOrzSz1/vHnWNB/cdArthOW1BNxRRh7j4mFO4Lh1rs05M5AZjD 08TUHo+g8XwInuu1sh7TCQ19rrSofagOAr+PhFCKENHKpNZrBV+/93wfg2Bc+u2NQP1Pr Ka9i5bjrKbjXVH9SRZQhhjrB1k2tVUNGZqc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" if the ffs size is invalid, break the iteration and return NOT_FOUND. Cc: Ray Ni< ray.ni@intel.com> Cc: Bob Feng Cc: Liming Gao Change-Id: I9e320d6176af350ff208901209f3f6c89e4e1924 Signed-off-by: Yunhua Feng Reviewed-by: Yuwei Chen --- BaseTools/Source/C/FMMT/FmmtLib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/Fm= mtLib.c index 9ec511ef06..6858cfe778 100644 --- a/BaseTools/Source/C/FMMT/FmmtLib.c +++ b/BaseTools/Source/C/FMMT/FmmtLib.c @@ -1769,10 +1769,17 @@ FvBufFindNextFile ( (*Key + sizeof (*fhdr)) < fvSize; *Key =3D (UINTN)ALIGN_POINTER (*Key, 8) ) { fhdr =3D (EFI_FFS_FILE_HEADER*) ((UINT8*)hdr + *Key); fsize =3D GetFfsFileLength (fhdr); + // + //if the ffs size is invalid, break the loop + //the size defined in EFI_FFS_FILE_HEADER is 3 bytes. + // + if (fsize =3D=3D (UINTN)((FvbAttributes & EFI_FVB2_ERASE_POLARITY) ? 0= xFFFFFF : 0x0)) { + break; + } if (!EFI_TEST_FFS_ATTRIBUTES_BIT( FvbAttributes, fhdr->State, EFI_FILE_HEADER_VALID ) || -- 2.12.2.windows.2 -=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 (#58947): https://edk2.groups.io/g/devel/message/58947 Mute This Topic: https://groups.io/mt/74091393/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-