From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.1157.1649292771395198044 for ; Wed, 06 Apr 2022 17:52:51 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ass6z3pg; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: nathaniel.l.desimone@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649292771; x=1680828771; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=CKP7l8vGXkMh5QBafEQUYdRc2lp9HtXW2WXPRXsju0s=; b=ass6z3pglg929IOqv4G1EvPwCMNxeqXU+9ASdq9ba2MLZZt+CigiBMLD FMQzo6i7MrcE47vGn0Dvey4SQu9jDn90tJngwjayvq+x08WNdezUCNUqt 27bPsuGNYc47fTZoC0pQz8GmamhUJUil3czuHDLnNKJtdYSjEiQSkhjFZ +t9ITX97qJHcdavxXtLF3FbklCy4Ku/QXWEZtM+26Nv9Qhn13+kZ0PrOA GNl3Fqvj40gkMcW11DoQeNqFzdHDsjRsJcvjiECtbuNAL0oxr4rrDJ98p Zd2L4PKADTFrOfSi8KokeLEqORxTtSQ6capuNNpmx46p73R6jlwiEXFp+ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="347636264" X-IronPort-AV: E=Sophos;i="5.90,240,1643702400"; d="scan'208";a="347636264" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 17:52:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,240,1643702400"; d="scan'208";a="588597176" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 06 Apr 2022 17:52:50 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 6 Apr 2022 17:52:49 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.2308.27 via Frontend Transport; Wed, 6 Apr 2022 17:52:49 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.170) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 6 Apr 2022 17:52:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P8R2LwvCcSrVXCpKPtQ66IK2hwqVnrCvmmAwZhtlu6EcpL3o/228+XWYtpu/nb6C+HBnq0pB1np4j16h69Oo3k1jHuGBluiSk+cAUub1CGD02rHYV4/77BUK4xCAdtSzlo64DfPSxkK0yX32OVkV85X4Z1XYAwmYyAQ+7o56UKqaS6fiVrnHnHv7llS86gu8EhejB4qQxfqvUp78BTUE0RnSn/0xvAjDfonbQQd5ozBoO0WSGxjPH6CINip/WPI24WkRPg+IE4yxObe7KcRmyF+wnzRomJ0t/iDOQEiMUgTN2FdTVCl3gYp3p3ZzIGpOyAakiPEPvYMQLhKd2Z9+bA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EhGG2nM1EzYpUyP5owFTVz3teWb6xkKtbpc2gv1apX4=; b=hhrGkSDsc7bYfRJvfaB6NsHC+Gh4efjcsadQyuXhkB0hA6PZza9XgfOUMiFM8wHmEyXbaLTjLZ7OwIEakvOF6+ZhdFvxNkcV3l59TSKSi3DBEZb1gFNcyPtJMf23AeO/C7BwX/0W6C92M1laCAlcpOEtBpJLH3bylQYhNLIuig6U8BkbtCI6MH2CrygJIGYpyIL36BN6m7/9XNQOgKrl2+SwPQtHexa54pVfBXd5RtXaicUZTgtWHxgE7aghfM9qDQrXkLaqLx/Hw8TI0+8Jyooz+qzOoZPQBCBZbwokoSbYAOY+rjGL1Ocxr5lkNHSw+oN2phXsTbeQJjsejQFJdQ== 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 Received: from PH0PR11MB5832.namprd11.prod.outlook.com (2603:10b6:510:141::7) by BYAPR11MB3574.namprd11.prod.outlook.com (2603:10b6:a03:b1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.30; Thu, 7 Apr 2022 00:52:47 +0000 Received: from PH0PR11MB5832.namprd11.prod.outlook.com ([fe80::ad86:86fe:a02b:174f]) by PH0PR11MB5832.namprd11.prod.outlook.com ([fe80::ad86:86fe:a02b:174f%4]) with mapi id 15.20.5123.031; Thu, 7 Apr 2022 00:52:47 +0000 From: "Nate DeSimone" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: Bret Barkelew , "Chiu, Chasel" , "Gao, Liming" , "Dong, Eric" Subject: Re: [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Fix mis-parsed HSTI structures Thread-Topic: [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Fix mis-parsed HSTI structures Thread-Index: AQHYPlL61TlXERmkG06YsNrbN4vXYKzjttiA Date: Thu, 7 Apr 2022 00:52:47 +0000 Message-ID: References: <20220323011053.9546-1-mikuback@linux.microsoft.com> In-Reply-To: <20220323011053.9546-1-mikuback@linux.microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 946ba022-7405-4200-cac2-08da1830ef43 x-ms-traffictypediagnostic: BYAPR11MB3574:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lXgSAl0m70uH8sWhdeSzTts+eW/62fokqyd2bqvNPsCwo9AKsCa7RkVGFuyn9UDm6YG3D2jazRflUT2nboHI3s5WECpeWvFftIE9T0le0q/hHOXIwLgtZSxzgNUQLUMP6lFxqQShydpCFnASxtFSGoC+kyNY9WfdI0AgnL5i850ardpuU3qcSgWY6Mk3jJWs8xdWPqRzIWQ6e+yfazZ4F2u66ugfBKde69L9HuepKgbGtcZO8mJ41GC0ABRkJjiVypyMKCXMaBNjxtd0BeyIlL8MU7vQa7H823TrqiPoJdL2A07UCzMcSA4Ms/8QT3t3gMllEFa7kbGLvhxKXMnAZ8Em2AAb5pixu3b4H3p1xAq2FWHZdPhAmqCbzjJCWfV1ZMeYXKBlJPheMK1nLBnJpd5NBWX3HC1i3UDXodwLpEizPjvU5qd5uyM/WKA7oV4Cb2oSbaQ6Boac3qPHnt9nej/aJE1ho36zja/28+1Ik7gnxtXtPLJwpmL1emyZs9elVDQ/C7j2leR6+VI/dD5M2Jp29MhZjw6nyPXpbOqoJgs3/GJQV5wlR0FuHE3ceVQLQyg0hylnWBboOSCAemgpWW5BS+fZpDqptpXH4mM60yRy5CBnqabNNrPIg4G5w1pf50O8D4YdPcBvYwRQN563PLY7w3WTDF/FvGGOEJsIjwWE+ldsM34RRxnWfB9tvRcQIzn5sCk+rSZ77EJemBjWZkxwEADx5HFIxTKRnoFBblxWFaGNxhgsPeRWbQn6cbuuu7Z0GOUs3lBF/yQvw7qbVgxnzO3ZV0MOvyD50j7YqVg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5832.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(83380400001)(53546011)(26005)(9686003)(38100700002)(186003)(86362001)(107886003)(82960400001)(38070700005)(2906002)(122000001)(5660300002)(71200400001)(110136005)(64756008)(66556008)(66446008)(4326008)(316002)(8676002)(8936002)(76116006)(55016003)(52536014)(33656002)(54906003)(66946007)(7696005)(6506007)(508600001)(66476007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gw84VdCdPhQbhjHZaocO1nAIX7EZZMxEJ+IvqTyiYxXAo9HyOqhF1fYtxED1?= =?us-ascii?Q?YSw0Ay/CLTnX8iQU2cfMLtG7xfLhahFuBLI3eCijIZW8ZyJU0xrVRp5cYVRl?= =?us-ascii?Q?tUhaXw6ipjRkQbl1LVHedpod8yZDy/zh0Zxhs+/ukRUDeZdQS73+MYE2GAVM?= =?us-ascii?Q?IkN8RuTKb4gLMEe9+Vu9PyXI8m/e0AifpcjxhVUJsQWXG44hUI0bLA4nXwf8?= =?us-ascii?Q?tCdruQGZnpJyKAJJvd9SdRtHZwGi0b208I9vpxed14H0DXIcrLJUDHWDs28H?= =?us-ascii?Q?K67Nm93tbTKHUE4CGRBSxxvcjEXYzYcwNvKqJHUpHH1ECR5uUVVDKKgwCYpI?= =?us-ascii?Q?vkA2IOLXxCn4pMPrEJ5HioF5dJyUoBIvqCFh4WX8miuPGt039YR/WOdbE7jg?= =?us-ascii?Q?EGI5UxylnHDY5+op8bMoe/OcS1qcMtFNWwKkicPrm+u6esAIqtPKSEZecChN?= =?us-ascii?Q?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GV5+8Id00ndyL?= =?us-ascii?Q?v/ofFCkb3CvhZu5NKwnec/h20QmSWrl+VqjUXy+k8I0RZJpYFfz3tO48eOXb?= =?us-ascii?Q?nIQoGOkHKn6Mh87VMRXuIa6Z2uHMZEeRnwUCmh/Tij23BZS4ap046PKHrE/b?= =?us-ascii?Q?fCx7TI2AdvaS7Svjr4bvQC2n0MuFZPLw4xJmU7A8yhCvlvwd1scI/W7ebzap?= =?us-ascii?Q?yoAwwjtm2Xp1jQb7tjJDpPZ2pDahqZWZvFZfIryApgLWF3h9yNNwYCoUSF/M?= =?us-ascii?Q?sE1nwZOyKNlMh0DenD+dGznqG6oFnJI2N5+ecdnaDyP4Dl7al0jlh/hxFJy3?= =?us-ascii?Q?SydewtAhclIKv54todEdx3rvboPEplIq+5/jKgqioCwdR4jNwmKcUIhKREQJ?= =?us-ascii?Q?QgEAXHWYrMLWfTa20OvvFhNcCOB+Nik=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5832.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 946ba022-7405-4200-cac2-08da1830ef43 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2022 00:52:47.7259 (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: qNQIvdWkYBgf9QU1+xx6qGJJLlaSke6VfK5JVD0sJiDIe1fjj3XE0U1wSlDmwXJ4sn4cYKaImhxw6YVTIYdZdX3RgnC5wfauVmSkgzWB/v8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3574 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone -----Original Message----- From: mikuback@linux.microsoft.com =20 Sent: Tuesday, March 22, 2022 6:11 PM To: devel@edk2.groups.io Cc: Bret Barkelew ; Chiu, Chasel ;= Desimone, Nathaniel L ; Gao, Liming ; Dong, Eric Subject: [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: F= ix mis-parsed HSTI structures From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3612 Printing corruption can occur if the DumpHsti helper function encounters a = structure from the IHV (i.e. one that contains the 'Required' field). Co-authored-by: Bret Barkelew Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckHsti.= c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckHsti.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLi= b/DxeCheckHsti.c index 7756369ae17b..f2f3fa83a57c 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= Hsti.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh +++ eckHsti.c @@ -40,6 +40,16 @@ DumpHsti ( DEBUG ((DEBUG_INFO, " SecurityFeaturesSize - 0x%08x\n", Hsti->Se= curityFeaturesSize)); =20 SecurityFeatures =3D (UINT8 *) (Hsti + 1); + + if (Hsti->Role =3D=3D PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) { + DEBUG ((DEBUG_INFO, " SecurityFeaturesRequired - ")); + for (Index =3D 0; Index < Hsti->SecurityFeaturesSize; Index++) { + DEBUG ((DEBUG_INFO, "%02x ", SecurityFeatures[Index])); + } + DEBUG ((DEBUG_INFO, "\n")); + SecurityFeatures =3D (UINT8 *) (SecurityFeatures +=20 + Hsti->SecurityFeaturesSize); } + DEBUG ((DEBUG_INFO, " SecurityFeaturesImplemented - ")); for (Index =3D 0; Index < Hsti->SecurityFeaturesSize; Index++) { DEBUG ((DEBUG_INFO, "%02x ", SecurityFeatures[Index])); @@ -81,7 +91,7= @@ TestPointCheckHsti ( EFI_STATUS Status; UINTN Index; BOOLEAN Result; - =20 + Result =3D TRUE; DEBUG ((DEBUG_INFO, "=3D=3D=3D=3D TestPointCheckHsti - Enter\n")); for (Index =3D 0; Index < sizeof(mRole)/sizeof(mRole[0]); Index++) { -- 2.28.0.windows.1