From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=017613bde0=jason.spottswood@hpe.com) Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by groups.io with SMTP; Mon, 30 Sep 2019 14:23:45 -0700 Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8ULDP0n031848 for ; Mon, 30 Sep 2019 21:23:40 GMT Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 2vber09qc9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Sep 2019 21:23:40 +0000 Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3427.houston.hpe.com (Postfix) with ESMTPS id 8C2B857 for ; Mon, 30 Sep 2019 21:23:39 +0000 (UTC) Received: from G4W10205.americas.hpqcorp.net (16.207.82.15) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 30 Sep 2019 21:23:39 +0000 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (15.241.52.12) by G4W10205.americas.hpqcorp.net (16.207.82.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 30 Sep 2019 21:23:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ko5Q70Y5rBonLSP/HQM7evtfH2ggY/tAVd1u3oYkLt4H7glG/EqByJ27bElDxqV5stjp/7Lsz/xTna+IgwNEOuX2v6+YNvg6xg4zLJC4r0fFiZs353u3GYqSt7AiWPOzmb8JW72LLUiGDWsPcPpvXKMMnFVM5RtRcVD5tKW8RQiFaJgIzAFttF3BIoVCfnpju+nBjXpLpvKnc9Q1ZedLWI48kXb1wkkUaa0Q/9fRY8sCpVssfIjaHlppz665XYhD6KNTUmvdqcZwuZFNMEY5O/6Kf+gvDFm/qREWqAclzGkoeVJ/9gMrtF9lNWOekUoY7nlEEfugvfmyjjvTlFqwXw== 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=mbwVoY28JuOfZ3ruWCkVNfwSjpmEM23E0KSOnwKPvgI=; b=TPKq+OTbKPXjjDZ/6w+caGmRq+/B6FIBqUE1fv2SdFS9Ln4b+I5YDE49Csx06u2X0/ww0fzFeIIlpAzO756jKovhKwNFT5ajiWC43dIP5hkKM2F/VZ9BL34NXizxhvMCgVPRZ9A0RrlDddJwVwzG+a966E1UhESN6xg3s5wjp5/akExmY6MDFgf9iV0uFGgDHkbC7LYuL5LtvdSJiAgEJ8T/PQAZRbEUSPaK78/OULat6ypRTd1G3wZHngdi8T/TQdNAY0y/MyN9cHgxqxNu6u5WAa0a1Zi40inUL3jwIBn7LE5fKbT5hhzbDd7gZWDQD2grij2G78xHBgxHgjUXGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from CS1PR8401MB1239.NAMPRD84.PROD.OUTLOOK.COM (10.169.13.138) by CS1PR8401MB1031.NAMPRD84.PROD.OUTLOOK.COM (10.169.96.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Mon, 30 Sep 2019 21:23:35 +0000 Received: from CS1PR8401MB1239.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5533:5111:6606:ad27]) by CS1PR8401MB1239.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5533:5111:6606:ad27%12]) with mapi id 15.20.2305.017; Mon, 30 Sep 2019 21:23:35 +0000 From: jason.spottswood@hpe.com To: "Rothman, Michael A" , "devel@edk2.groups.io" Subject: Re: [edk2-devel] Recent changes to EsrtFmp causing ASSERTs Thread-Topic: [edk2-devel] Recent changes to EsrtFmp causing ASSERTs Thread-Index: AQHVd9BvxCzZ8I3Aqk66CRXZJUK8kqdEsnMAgAAIRaA= Date: Mon, 30 Sep 2019 21:23:35 +0000 Message-ID: References: <19681.1569876496768913642@groups.io> <709B20DB-2303-422B-9244-C7F9DD6CF535@intel.com> In-Reply-To: <709B20DB-2303-422B-9244-C7F9DD6CF535@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [15.211.195.12] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4d3e7e21-5a66-4ade-7b32-08d745ec7403 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: CS1PR8401MB1031: x-ms-exchange-purlcount: 6 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 01762B0D64 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(396003)(136003)(376002)(39860400002)(366004)(189003)(199004)(606006)(76236002)(6506007)(53546011)(71190400001)(476003)(790700001)(6116002)(71200400001)(81166006)(8676002)(81156014)(446003)(66066001)(3846002)(7696005)(11346002)(6246003)(102836004)(25786009)(26005)(76176011)(186003)(33656002)(74316002)(5660300002)(478600001)(52536014)(66476007)(66946007)(66556008)(64756008)(66446008)(229853002)(316002)(2906002)(54896002)(55016002)(486006)(7736002)(6306002)(2501003)(8936002)(256004)(9686003)(6436002)(86362001)(14454004)(110136005)(99286004)(76116006)(236005);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR8401MB1031;H:CS1PR8401MB1239.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4xFiLTK2zlTTN6qT1DQ4A+ENqq4QVtM51r9uCB+/nD2dYPD1xehdY0UCTDpdVWYfuiZVXREMObHTBSTX0yMPfN0yywEp76R2KMV0/YylautNVoXZ6qcPL/XxaSo67ezxqrt6VEu3b8w0FR1mBrFSTUAHLVlN1GslyQT5L2B8jmvMphJdysRhBbse35BHrcejrZXgc7w7kkEn9UCpnpU8XJDRXqz6FpzJzzSWKdRWLXqQ6jY9uD8797nkTt85yyZ4IpTFwLa2iQhJ+QmQCZW9ru5UTitlEN4BydE3M1gKww0XCD16+WhmT72qni/okfopWFYpC4VK5IVuoxxr7BxPRvT3RO1/3fccVdK0bDmbBiEoIJ0oI1lymO7w/snqfGqv7y0iNVsg65+qH8CD+ESbVH+/C/rtYColDNcXoodVN5Df5crcVpL/9ArTRYBO75bnq0UCXUGB7j8LWuAtjCtquw== x-ms-exchange-transport-forked: True X-MS-Exchange-CrossTenant-Network-Message-Id: 4d3e7e21-5a66-4ade-7b32-08d745ec7403 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2019 21:23:35.6328 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: S4ZaaQAfCIrQ2t5M4YPLt3ZY1gTa7nADd9WDH6k5V236wCVvrEJP3bIXuplzT2BzaYaApuozLgUQJQFE2m43E4Jk7U6pybYBIZJDSkbvg7U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB1031 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 12 URL's were un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-30_12:2019-09-30,2019-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 clxscore=1011 mlxscore=0 bulkscore=0 phishscore=0 adultscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1909300179 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CS1PR8401MB1239E499F034196275A2968D93820CS1PR8401MB1239_" --_000_CS1PR8401MB1239E499F034196275A2968D93820CS1PR8401MB1239_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cut-n-paste problem. My apologies. Copying again in plain text: // // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique // for (Index =3D 0; Index < *NumberOfDescriptors; Index++) { if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImageInf= oBuf->ImageTypeId)) { if (HardwareInstances[Index].HardwareInstance =3D=3D FmpHardwareInst= ance) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image descrip= tor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf->ImageTypeId, F= mpHardwareInstance)); ASSERT ( !CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImage= InfoBuf->ImageTypeId) || HardwareInstances[Index].HardwareInstance !=3D FmpHardwareInstan= ce ); return EFI_UNSUPPORTED; } } } -Jason From: Rothman, Michael A Sent: Monday, September 30, 2019 3:53 PM To: devel@edk2.groups.io; Spottswood, Jason Subject: Re: [edk2-devel] Recent changes to EsrtFmp causing ASSERTs Jason, Agreed - though that image you sent was challenging for these old e= yes. Black on dark grey? Ack! Thanks, Michael A. Rothman --------------------------------------------------------------- Let no excuse be a barrier to your success. On Sep 30, 2019, at 1:48 PM, "jason.spottswood@hpe.com" > = wrote: In EsrtFmp.c, function CreateEsrtEntry, line 196, the code asserts if the = FMP image hardware instance matches that of an existing instance. This is = fine if the hardware instance is supported. The field is optional though. = In the UEFI spec, "a zero hardware instance means the FMP provider is not = able to determine a unique hardware instance number or a hardware instance = number is not needed." The code below needs to also check if the hardware = instance is supported (by comparing it to zero) before checking it against = existing entries. // // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique // for (Index =3D 0; Index < *NumberOfDescriptors; Index++) { if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImageInf= oBuf->ImageTypeId)) { if (HardwareInstances[Index].HardwareInstance =3D=3D FmpHardwareInst= ance) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image descrip= tor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf->ImageTypeId, F= mpHardwareInstance)); ASSERT ( !CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImage= InfoBuf->ImageTypeId) || HardwareInstances[Index].HardwareInstance !=3D FmpHardwareInstan= ce ); return EFI_UNSUPPORTED; } } } --_000_CS1PR8401MB1239E499F034196275A2968D93820CS1PR8401MB1239_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Cut-n-paste problem. My apologies. 

 

Copying again in plain text:

 

  //

  // Check to see of FmpImageInfoBuf GUID/HardwareInsta= nce is unique

  //

  for (Index =3D 0; Index < *NumberOfDescriptors; In= dex++) {

    if (CompareGuid (&HardwareInstances[I= ndex].ImageTypeGuid, &FmpImageInfoBuf->ImageTypeId)) {

      if (HardwareInstances[Index].= HardwareInstance =3D=3D FmpHardwareInstance) {

        DEBUG ((DEBUG_ERR= OR, "EsrtFmpDxe: Duplicate firmware image descriptor with GUID %g Hard= wareInstance:0x%x\n", &FmpImageInfoBuf->ImageTypeId, FmpHardwar= eInstance));

        ASSERT (

          !Comp= areGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImageInfoBuf-= >ImageTypeId) ||

          Hardw= areInstances[Index].HardwareInstance !=3D FmpHardwareInstance

          );

        return EFI_UNSUPP= ORTED;

      }

    }

  }

 

-Jason

 

From: Rothman, Michael A <michael.a.rothm= an@intel.com>
Sent: Monday, September 30, 2019 3:53 PM
To: devel@edk2.groups.io; Spottswood, Jason <jason.spottswood@hp= e.com>
Subject: Re: [edk2-devel] Recent changes to EsrtFmp causing ASSERTs=

 

Jason, Agreed - thou= gh that image you sent was challenging for these old eyes. Black on dark gr= ey? Ack!

Thanks,

Michael A. Rothman

---------------------------------------------------= ------------

Let no excuse be a barrier to your success.


On Sep 30, 2019, at 1:48 PM, "jason.spottswood@hpe.com" <jason.spottswood@hpe.com> wrote:

In EsrtFmp.c, functi= on CreateEsrtEntry, line 196, the code asserts if the FMP image hardware in= stance matches that of an existing instance.  This is fine if the hard= ware instance is supported.  The field is optional though.  In the UEFI spec, "a zero hardware instance m= eans the FMP provider is not able to determine a unique hardware instance n= umber or a hardware instance number is not needed."  The code bel= ow needs to also check if the hardware instance is supported (by comparing it to zero) before checking it against existing entries.

  //
  // Ch=
eck to see of FmpImageInfoBuf GUID/HardwareInstance is unique
  //
  for (=
Index =3D 0; Index < *NumberOfDescriptors; Index++) {=
  =
  if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid,=
 &FmpImageInfoBuf->ImageTypeId)) {
  =
    if (HardwareInstances[Index].HardwareInstance =3D=3D Fmp=
HardwareInstance) {
  =
      DEBUG ((DEBUG_ERROR, "EsrtFmpDxe=
: Duplicate firmware image descriptor with GUID %g HardwareInstance:0x%x\n&=
quot;, &FmpImageInfoBuf->ImageTypeId, FmpHardwareInstance));
  =
      ASSERT (
  =
        !CompareGuid (&Hardwa=
reInstances[Index].ImageTypeGuid, &FmpImageInfoBuf->ImageTypeId) ||<=
o:p>
  =
        HardwareInstances[Index].Hardwar=
eInstance !=3D FmpHardwareInstance
  =
        );
  =
      return EFI_UNSUPPORTED;
  =
    }
  =
  }
  }

--_000_CS1PR8401MB1239E499F034196275A2968D93820CS1PR8401MB1239_--