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.web10.6341.1654957241200268256 for ; Sat, 11 Jun 2022 07:20:41 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LobGv84s; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: jian.j.wang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654957241; x=1686493241; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=h8PrbZ3WrPba8P+1UIgLHBww2hGNWnsShG+Gmpk6vec=; b=LobGv84smoxqudUix8F4iLVwdsou2uk2ds+KecNnf/lwFXUrLgG89fja c59auD+/MEX4wryvCaAFsH0gWQ116ID3XCdFhMkikI/HtbQ7qsBef4EGg RUVRq5P6MyopAonWGbIJaGBjsQdjO7GnUmZnmTtkW1gkp5h7k2qqs85La lsoJQq1LllS5Re2nrRrl4NtkOQCCuVH/pZTVbS1NTAbGuhOczCXqgCqle 4NdQjs7V/VRgVDTSDBLSbd+SbFkzfB9+NcR8vOSbAVLJa71JEfwNWTDFD MyxFKk1P+MKASOy1B0/FXymfuRH8ifYtEkalauBvD4wpO4UzULlFEiWkN A==; X-IronPort-AV: E=McAfee;i="6400,9594,10375"; a="364220266" X-IronPort-AV: E=Sophos;i="5.91,293,1647327600"; d="scan'208";a="364220266" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2022 07:20:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,293,1647327600"; d="scan'208";a="828788481" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga006.fm.intel.com with ESMTP; 11 Jun 2022 07:20:40 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sat, 11 Jun 2022 07:20:39 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Sat, 11 Jun 2022 07:20:39 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Sat, 11 Jun 2022 07:20:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VT1rKZ4Rp/Z56u4SPe01qmzLEUGn0T4cfHj5Lg/tl77A1Ri2aKBTW9UKqpJBJCPPM+Bw2O5HhJqQlFpL3KiWUe+V6+AfXMIZ2OboBdzySq5NiMdWFQuFLIcAv0LafqoyDO6feXlq9a6U0dbijzhc+o151FTV/xjYntf82TQaFvgCcCJu3zP5tyIIWS2FFoUS7dgxp/ciXwAnbGgVgd+moe0qMmzn+93JIX0t4inD49JzJWK2FqtZgyhdSKgrm0WgKJPbgnvbVliIsOuYw2qmtsFRkrnVDJd+RST7jnS+p7AC2F+3GLfYm/zecyQfkijJGbuH9E61zheWM3EGatysKg== 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=p7QoguhM7xpJM/IbExcC2jKDC9gfLRMKg6s2yVKeHZk=; b=etQo/Hn8vpT23bOUJOa1zKD5bbaQHG7+xzSFgqwGvNLBL/NCTqA7PXHKQhSfk5RUXTO6LD+DhzAkMOKzWT40Jg/Uswes6cX+QoCmTyZCe9MaP18gnw6g5KS+MG3lsj8qsZlvblBCcW5ARUdR5x5RN6yMG7CnDFUJMKXMQjfb+NteFn47CsVpISeDElaQCHxbqJ1/jykZ0O1+8SF4onSVRwgy1jRk0rkE0HAHdyGO6nvLk74RKKdwWft/lkuHiKSpah/oAIZEpFp0IsBK3BwwqFit+e5awXcrnPdRBTDJCu7RbP/8u9m4A0p1wOmRfn9Ja3CL61FPQlnJDII7aUAH8Q== 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 CO1PR11MB4945.namprd11.prod.outlook.com (2603:10b6:303:9c::8) by PH0PR11MB5611.namprd11.prod.outlook.com (2603:10b6:510:ed::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Sat, 11 Jun 2022 14:20:36 +0000 Received: from CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::a420:db2c:31db:7906]) by CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::a420:db2c:31db:7906%9]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:20:36 +0000 From: "Wang, Jian J" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH] DxeMain: Fix the bug that StackGuard is not enabled Thread-Topic: [PATCH] DxeMain: Fix the bug that StackGuard is not enabled Thread-Index: AQHYfKcVZLELfwviNEiz4SVUMdKuC61KQ3rw Date: Sat, 11 Jun 2022 14:20:36 +0000 Message-ID: References: <20220610084946.853-1-ray.ni@intel.com> In-Reply-To: <20220610084946.853-1-ray.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.500.17 dlp-product: dlpe-windows 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: d7da04d9-f777-45dd-29ae-08da4bb58de9 x-ms-traffictypediagnostic: PH0PR11MB5611: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: R1rSQWoQwWC8gIT9sGrQpsfYVkAcWSEYpBzk+X1vK/vpU+uuTeTHT1YQCS23aMKQHnZK7gE9EGzZ5flPVwaDU6YaIB1p8MGU/MkeyT7wF7nfuv2p3BXSEhwBnIGhFwL3NMjsGH8LNGaOGGe6pKN0gaMXStZAqq8dtncdInMinwwOSy0sneQYqKxDXJkWNz05YKTRxCrYPYWluPsEnU0OO6V4HoncErdlSgYui9tDDLgXZ0UBeStX/tTvuK4V8nSNsRZpmvhX45greqBEKrghNRhk/6yQIjr0EW7u1uy+3bXp1DTlGvFtMzrnjrCbwvkyMjxKzvqq4K++WtDTPEdWhyoLcptbIwKXdA6mt8YampwIwZIpNe7FpCD0RyPLEqL7YCdeCHSqdKqH1TcE4Y4xprqdx2LMIStvwhe4QqTaxSAUk0/qHxDrMDvRj37019gcyqVFKqSntxXMBtO0qpp1p9CUONpwRe6rIQEYXOeIlofvAlJ5Ms0iwkQ7kNETnUGllS700vvQaJmgSObegKhsJs+RD5LG2hPQkHxnjZxicTBoOGiY4iryuMQKEAeVHh+cZWwpqEFkMvcBPu2ZYGV2mv3u+quWFllN5X2fk/rlX0MICcKDkjTuFZDpLs9Yp/F0OdQDSypSQktwPzM28mH9VrMPhZpfkUg59pl7cPM6W/7D7iD7G/OuCrMFxDccFpWNpULQHq4QODCxtnO1mZmK8A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4945.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(38070700005)(71200400001)(83380400001)(82960400001)(122000001)(508600001)(76116006)(66946007)(66556008)(66446008)(64756008)(8676002)(66476007)(4326008)(86362001)(110136005)(316002)(186003)(7696005)(6506007)(53546011)(38100700002)(26005)(9686003)(55016003)(8936002)(52536014)(5660300002)(33656002)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jncUkB1+X9l1pyKfA4DjwBAUtHHsECF3da/Cx3BGQwaH0oJTB5+ujh9S7tTJ?= =?us-ascii?Q?UQYt/H+uO308ceQSQLLu4BIlXG+8Lbocxt6KN7W3lYUDUWSzMl92qyuewTKI?= =?us-ascii?Q?kf2Rbjt+VnVA9qthoRk7ERM2s+r2hleQRsRfF13G3mh4FBmVxhbhk3JokTSI?= =?us-ascii?Q?7AP4uX2R3vPwzfKRDWAJfGiYmUEYFHNy+puwj7BJFYxLZpNUgICaI1Ldns3/?= =?us-ascii?Q?V/xQHL4N6nUzO7XPTnYZxwC4TdwWkI4JN2AL2a5il/yIzB4aZqLYbDBAUppe?= =?us-ascii?Q?nWkOZlBy4JrzeBNPUqdQDBx9R9wRRxJ2cHGuiW9AYDeS4iabz7dyUmNlf37U?= =?us-ascii?Q?Qp79LtRDbyaaX+xbt8qTo5+Et/leQ/DYYZ3j3HrLMpZzb/nZYEykVBk6MGQn?= =?us-ascii?Q?cC2gUZ6d1rIUvPgnwn6AE7HE3npi6vaKlXZNd5CjA/MQ8SYXja1UQ7UKqVI6?= =?us-ascii?Q?E+iYtSQKJa+2kv0p0XO5MI/2UBWdW2eMe9rgiIcC+gkSWh4U61wyYSEu4qjz?= =?us-ascii?Q?8yw9sdTyk7ERR+Qw9ocuqkQineSLjmfOPwy5ZQ8mADB89deJSS3szJMzvhM1?= =?us-ascii?Q?3YLK/H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D19mb/s?= =?us-ascii?Q?1tXNj+Y+qvcKyyeY+UWhAOp4uPx/EaqnzOdZ28cPD4ja+88tLDaBm3FAR4Wx?= =?us-ascii?Q?aulS4wsMfMFiH+nJAJDdqEvfeRet/pD254DjWyCUoMmQWgtQvIwJWuuqC5wg?= =?us-ascii?Q?go1PJc0H9AGIk77GVvuvAoXAljZ05030C9tCdneU9uvr2GPVlWI2Ws/1Jc98?= =?us-ascii?Q?mz5A1khYarFCZBccBQ1HJGQvzrFG+6jkC8B2B4k5Jt/OGa9AAz17qwKUum4z?= =?us-ascii?Q?VQLjtwWhwQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4945.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7da04d9-f777-45dd-29ae-08da4bb58de9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2022 14:20:36.8222 (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: poevOe16ALOfJvk+LRjziGGPezHOgQoigrZRoyMFBqxdY8QguSwRcsyRCx/n9243gKBNDCLyFn2h2N871waKFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5611 Return-Path: jian.j.wang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jian J Wang Regards, Jian > -----Original Message----- > From: Ni, Ray > Sent: Friday, June 10, 2022 4:50 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Gao, Liming > > Subject: [PATCH] DxeMain: Fix the bug that StackGuard is not enabled >=20 > Commit e7abb94d1 removed InitializeCpuExceptionHandlersEx > and updated DxeMain to call InitializeCpuExceptionHandlers > for exception setup. But the old behavior that calls *Ex() sets > up the stack guard as well. To match the old behavior, > the patch calls InitializeSeparateExceptionStacks. >=20 > Signed-off-by: Ray Ni > Cc: Jian J Wang > Cc: Liming Gao > --- > MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c > b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c > index 83f49d7c00..0a1f3d79e2 100644 > --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c > +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c > @@ -256,6 +256,14 @@ DxeMain ( > Status =3D InitializeCpuExceptionHandlers (VectorInfoList); >=20 > ASSERT_EFI_ERROR (Status); >=20 >=20 >=20 > + // >=20 > + // Setup Stack Guard >=20 > + // >=20 > + if (PcdGetBool (PcdCpuStackGuard)) { >=20 > + Status =3D InitializeSeparateExceptionStacks (NULL); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + } >=20 > + >=20 > // >=20 > // Initialize Debug Agent to support source level debug in DXE phase >=20 > // >=20 > -- > 2.35.1.windows.2