From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.97301.1683508126417995175 for ; Sun, 07 May 2023 18:08:46 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=eRcFI52W; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: linus.liu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683508126; x=1715044126; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=99EiJu7akq2IRfmEx0cMSaankLN2CTRMdIo22cp8V48=; b=eRcFI52W/KCYXzXCbsGlIRVSrlJtZ2miyrd9Vji6hjhuY9sV6c0OAqmN Td3b6mtSh+qiBK4xsiVHQ5eAnde/6TtNJOKcl9lPOByBdExwzwZhb6I/4 BLLYwc3jzcOZBDwnlMoaH+ziThiPYxVWzsAO6KbcPdBeaWtkRg6eNidIL NBXCntVltp5xzse4zWvqoMPdMhbO8WLeLZPLHAay2Z+WRh1MBMUvhI4EH Et0YikB2PrKTSlBWjyg7WqJX7sixvw54A5qiAHOmVv+uViW0xDPSxvdpH ClJ39mXVYmAoS4A1tXjJO0YpC/A8StmaYE6r1pcOy2R6Ec+fWuFJxth9i Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="333963158" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="333963158" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2023 18:08:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="692429041" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="692429041" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga007.jf.intel.com with ESMTP; 07 May 2023 18:08:45 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 7 May 2023 18:08:44 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Sun, 7 May 2023 18:08:44 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.41) 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.2507.23; Sun, 7 May 2023 18:08:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YHRv4bfraQXuZ5kuR/SWCJJrL50cuGm4M9ZeBee49TY/TruqptqXmltuA20D99hIjDQQTlJZG3mgIBT/qRJAJlxv2i13MGC0I0+xq3zxYnNCSeIHazto2wYyfTXBRICFDmjHah24pYneD81RQfZoh+lOIfR3C5TexcgB1cXFIf9ElYHDYRMqm1Ph+ln/zNdWbtap9TW5idVIJMTwaRjOSwU7GFJeGI1VYHqcWaYxkeVB6bRsFjX6kqEwsB5rsVFDu4jk5M7UGsXHPSOLHaGE/AAlHgkeMhCui5gnq/IMNnu7Vo3RyDNZiAx0ndSUWGKcr8R0fsToMsWzf5QL1I8wOA== 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=BCc3P5HXRfj8Y1YFhMSFBX/rUNZ9fDRtBdEENqoFXjs=; b=LClX3mhuYQ9Epmqwr1sO98UlQm5eqZNW6yO41gy5lxQMv7nBWW5rNj1cG7L0ao1MDj1CGCa2b4tRHurKwmtnOMrOUHfBkWXS2baIqZQgUsMSXin/VYcqrmOugG9BWpv6dyQotvIMRz46KAyNU6rHRK0SGR0fff+M5DKS4to+yefTpncnoXrZhytiNohLt/95ZpvhlDA3aliWS6H4a+7k+Bf+4LR0QJSYFDXxl/TaPCqbN7ogyD9k9gaXC5wOwyLmOrv/qaD9fqGbx+6heFhK0GhNYPWPYOd6opFOG8S4QBL9wlQvZkvrltgqBKxntXMS70yTEd03Jvvd/bINLcAeeQ== 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 PH7PR11MB5888.namprd11.prod.outlook.com (2603:10b6:510:137::11) by BN9PR11MB5321.namprd11.prod.outlook.com (2603:10b6:408:136::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Mon, 8 May 2023 01:08:41 +0000 Received: from PH7PR11MB5888.namprd11.prod.outlook.com ([fe80::ba8a:2867:509:b523]) by PH7PR11MB5888.namprd11.prod.outlook.com ([fe80::ba8a:2867:509:b523%3]) with mapi id 15.20.6363.032; Mon, 8 May 2023 01:08:41 +0000 From: "Linus Liu" To: "Yao, Jiewen" , "devel@edk2.groups.io" CC: FST-FIR-PRC , FST FIR Server , "Chu, Maggie" Subject: Re: [edk2-devel] [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy Thread-Topic: [edk2-devel] [PATCH] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy Thread-Index: AQHZbFwCEyp1DQojiUOhgZhU7VP89a9HSFQQgACNz0CAAAvGMIABu1PQgAFQMhCAAG/OsIAEW4cg Date: Mon, 8 May 2023 01:08:41 +0000 Message-ID: References: <20230411095524.1668-1-linus.liu@intel.com> <175C15AECAAF6F6F.898@groups.io> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: yes 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-traffictypediagnostic: PH7PR11MB5888:EE_|BN9PR11MB5321:EE_ x-ms-office365-filtering-correlation-id: f42ca7c9-6cfc-417f-3642-08db4f60c353 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vkrRxIcvhDcH4Cm8c/hZ/I1GMlVd1ui/O3gJ5C20p11LNOoBLNkMoBX5sXzDJqOO+usuBhMsbKoJCR4k3XJL5dPqgPKabFZlQMAimcxvRM8apjn+f6kl6KrCpcBBRzHhQ+ToP8OrLYwnaGRQLUL1rL4KJizbkfi6pOlrwD13sPlyESPbAg1qJsPVZw5g04JDt4xUSvOoFw3P/UuxJ+xpN5FsIXp/PczuwfI2hnKao547Fc3dA2Pj+qensgKnBNLhJRzqQY1FHqcsVhmAntAy0ZrOsupqmX2pZHe3epftl0zD3EafN2fccxqWyUcI/hkwaxC6wk7XbJYZml2tUNwgKc99/eYCwbWXsM2tFo6VeX1PDw6UIO0Ps2uhLXF967ARD6+flRZKmqpN3jLZO/m+GJAxmUh2hhcv+fdrNKA6PjO2jzQD8YhiFCYWnRT1fytKDFRbkIjAFIIbUsC1F4P+tpv36yFJ3+ucsaGJm1pr73vUZn9ao0vf5rmPZls5FmuA+OUfhA9SgjYJO4yp8FGTQ90vK82L9/mEDlN62zMybDGCUgGjmcWiIp/vbFvHhCYoeWVFFCNMXU9+npCaPfHzwpuSQ+amxSimCZh48BCH1l9Eag1S6BoS+e9QN0Nrf2C+2Ura/I/KTqKyErS1nmtOfA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB5888.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(396003)(346002)(136003)(376002)(451199021)(26005)(6506007)(53546011)(9686003)(107886003)(7696005)(966005)(83380400001)(55016003)(33656002)(122000001)(38100700002)(86362001)(38070700005)(99936003)(82960400001)(186003)(15650500001)(110136005)(478600001)(30864003)(2906002)(54906003)(5660300002)(64756008)(66446008)(66476007)(66556008)(4326008)(316002)(8936002)(8676002)(41300700001)(66946007)(52536014)(76116006)(71200400001)(66899021);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?729pDRhsnNnGwHJ9I7p3oEdWv47MAbyFXOPv8h7pCjKV5qun/fFpDr5G9y8W?= =?us-ascii?Q?giQKVodvENlvniZ+wwsnghBis2ABVnkaciSu1juFRN2uXPf7S5T2+hzoYSLs?= =?us-ascii?Q?TOttpYxnxb4VdGNOycrEIHpk5KRpfOPD1C2ldSTsqUzvAG2TprQsL2XumWl3?= =?us-ascii?Q?FKpv1VpLAo7ah00pFwljjvJAJaOUffmmIYhJd4DDrU/X32ATl5GPvSn8XCZx?= =?us-ascii?Q?ZzREuY7PT/UcuKGLfzLIXDmXMsLDlzC+YFMgsRBcgn7wvn04Ji4eT4fSokpu?= =?us-ascii?Q?PsARdfHRR0GcxdrYFjblSOM+ltI8p6f2F+mKstbiC/Pl6pzQsYTk0Q1Wmeb4?= =?us-ascii?Q?Bnlv3LBvNQLLO4e6S1c9+7v40ZRNWFCfp7nDU/klz9pmnHsBx2/OBfNiBqq/?= =?us-ascii?Q?Ofein89sroEvWtAhRYHq76w7tapQNWBQajIYGEATDg7dklNMoG89EJDDKvFU?= =?us-ascii?Q?QN2vS2rwRtqacB26ifeieKUjFPOe9yW0IxNa3TQTybY1X84rZCbVV542pMT+?= =?us-ascii?Q?v1J5ll6cV4oocujLcH+xXjx7xXWDD8meWQDKeTs5srDAB2GYCrSdXDwgr6JG?= =?us-ascii?Q?S1O2/zrEtIz4bMHszkf9hzyNtB6u1xoe5RbmIyyixlhs7XCUDuA7PkTm5W40?= =?us-ascii?Q?n/pWgRyRDxMrY5LIjerOH5xdU6KHMY4PFAqswq58WKOcu04hYW20jAZlLjNs?= =?us-ascii?Q?m5DVynKxycflU5lqjPOqIQkd1ArzeUZjXOIlBxfQoy1jDlA3u9dhLI0fBFiC?= =?us-ascii?Q?TdxK1RTk2vsr+9RzPx1+otet5QRTUH8WWGWe7jnJQx72LS9sJK3Fwey7Vttz?= =?us-ascii?Q?BO31kWfBp0NBiEAIFWVOuXRZVadYLlTSPcayiM3/Emj1s9GZOyGVZagZ1Kox?= =?us-ascii?Q?ooJNhO8dcq3p+JuPfA0CO/smgBUzUH8IOhOzzpSaWNeU+PaNbVqnayCNCy4F?= =?us-ascii?Q?DlhLeduOoDDE5+k9wD+06v1svcqfEZ/u+hEkZitOaSq84B1g/4Ti3O5mB0py?= =?us-ascii?Q?0kJq0AzvPAMj6le18vbAA7TEeKgNcZeAUNNQXVFsc6k7+NWkYUEraPKIvINz?= =?us-ascii?Q?kHn6TWtG1835AwcXr4M6trPrWbxRzggsMg6/f6uaJ1Y0EV1RZ3aftKliPBeH?= =?us-ascii?Q?dMD8bfyWd69ALSX4dT4qKMkbtZUxmGJ6qlCmyRHlAw16Dlctq8dRgsuM7Vp4?= =?us-ascii?Q?MBoM1p1rQLBRnaKreMtJXrLDXezlFDrds5SdWeJzxoRK8ec1nyKRVaoAT6EE?= =?us-ascii?Q?EnKkG+4JWll9e6QABwamz7oJ9zpuQ4qqTwioOpqYJLs9uTlI8DW5HCsQ0gGz?= =?us-ascii?Q?fwfrcjIsUeGLKSZ/+01jwOFdWPoLxQAQM9pvqOhevF+HiFRxJvPjAwXp5TYN?= =?us-ascii?Q?d5afiE0uZNFrY3dKo9kJTbc61hlUO1Ln7zjuzHXOt1OEAHnsPrhwTLmAGHow?= =?us-ascii?Q?2Hi7px5sASEEBigueUpPa8J4vdkR8IM79PNt/QmMPLzSgxEJaJ2DZrQBbRCh?= =?us-ascii?Q?O82p31t++raCKloXNhHr7TNyUBTSn2n7gzJ8o1eD0G1MNzVPyKV6YwwpNO/5?= =?us-ascii?Q?I6GXCJ6YdlMjcy4G8vBwPfbwVYgT+nBzJ6S8M6ZE?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5888.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f42ca7c9-6cfc-417f-3642-08db4f60c353 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2023 01:08:41.5398 (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: X88w4VXMly+C0JTzccjuhY2cPrHh/I1OAJy/to3U5gtQ9cgugSyGT0/TEgmR7F2sWurRhSq93vDuh390RAGieA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5321 Return-Path: linus.liu@intel.com X-OriginatorOrg: intel.com X-Groupsio-MsgNum: 104229 Content-Language: en-US Content-Type: multipart/mixed; boundary="_002_PH7PR11MB58885ECFEF0C6FDA63C074E4FC719PH7PR11MB5888namp_" --_002_PH7PR11MB58885ECFEF0C6FDA63C074E4FC719PH7PR11MB5888namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jiewen I did. https://github.com/tianocore/edk2/pull/4264 I think you used the previous patch. I've attached the latest patch. Please help to check this . Thanks. =20 -----Original Message----- From: Yao, Jiewen =20 Sent: Friday, May 5, 2023 2:30 PM To: devel@edk2.groups.io; Yao, Jiewen ; Liu, Linus Cc: FST-FIR-PRC ; FST FIR Server ; Chu, Maggie Subject: RE: [edk2-devel] [PATCH] Securitypkg/hddpassword: Update HddPasswo= rdDxeInit to use Variable Policy It seems CI failure - https://github.com/tianocore/edk2/pull/4334 Have you run CI before? > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Yao,=20 > Jiewen > Sent: Friday, May 5, 2023 7:50 AM > To: Liu, Linus ; devel@edk2.groups.io > Cc: FST-FIR-PRC ; FST FIR Server=20 > ; Chu, Maggie > Subject: Re: [edk2-devel] [PATCH] Securitypkg/hddpassword: Update=20 > HddPasswordDxeInit to use Variable Policy >=20 > Sounds good. Thank you very much! >=20 > Reviewed-by: Jiewen Yao >=20 > > -----Original Message----- > > From: Liu, Linus > > Sent: Thursday, May 4, 2023 11:51 AM > > To: Yao, Jiewen ; devel@edk2.groups.io > > Cc: FST-FIR-PRC ; FST FIR Server=20 > > ; Chu, Maggie > > Subject: RE: [PATCH] Securitypkg/hddpassword: Update > HddPasswordDxeInit > > to use Variable Policy > > > > Hi Jieewn > > Please refer the below reply. > > > > Have you done any function test? For example: > > 1) The HDD password feature still works? > > Linus : yes , HDD password feature still works. > > > > 2) The variable is really locked? > > Linus : I've tried using dmpstore command to write HDDPassword in=20 > > UEFI Shell. Can't override it. > > > > Please refer to the below log. > > [2023-05-04 11:42:11.046] FS1:\> dmpstore -guid 737cded7-448b-4801-=20 > > b57d-b19483ec606F -s HDDHDDPwd.txt > > [2023-05-04 11:42:18.835] Save variable to file: HDDPwd.txt. > > [2023-05-04 11:42:18.909] Variable NV+BS '737CDED7-448B-4801-B57D-=20 > > B19483EC606F:HddPassword' DataSize =3D 0x48 > > [2023-05-04 11:42:42.859] Load and set variables from file: HDDPwd.txt. > > [2023-05-04 11:42:42.934] Variable NV+BS '737CDED7-448B-4801-B57D-=20 > > B19483EC606F:HddPassword' DataSize =3D 0x48 > > [2023-05-04 11:42:43.082] dmpstore: Failed to set variable HddPassword: > > Write Protected. > > > > > > Thanks. > > > > -----Original Message----- > > From: Yao, Jiewen > > Sent: Wednesday, May 3, 2023 9:21 AM > > To: Liu, Linus ; devel@edk2.groups.io > > Cc: FST-FIR-PRC ; FST FIR Server=20 > > ; Chu, Maggie > > Subject: RE: [PATCH] Securitypkg/hddpassword: Update > HddPasswordDxeInit > > to use Variable Policy > > > > That only proves that you did change the interface. But that cannot=20 > > prove you change it right. > > > > Have you done any function test? For example: > > 1) The HDD password feature still works? > > 2) The variable is really locked? > > > > > > > -----Original Message----- > > > From: Liu, Linus > > > Sent: Wednesday, May 3, 2023 8:40 AM > > > To: Yao, Jiewen ; devel@edk2.groups.io > > > Cc: FST-FIR-PRC ; FST FIR Server=20 > > > ; Chu, Maggie > > > Subject: RE: [PATCH] Securitypkg/hddpassword: Update=20 > > > HddPasswordDxeInit to use Variable Policy > > > > > > Hi Jiewen > > > I add this patch into MTLS platform and collect the log. > > > The below is before adding patch and after adding patch. There is=20 > > > no warring message. > > > > > > > > > Before > > > > > > InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B > > > 67E4C490 > > > InstallProtocolInterface: 330D4706-F2A0-4E4F-A369-B66FA8D54385 > > > 68180030 > > > !!! DEPRECATED INTERFACE !!! VariableLockRequestToLock() will go > away > > > soon! > > > !!! DEPRECATED INTERFACE !!! Please move to use Variable Policy! > > > !!! DEPRECATED INTERFACE !!! Variable: 737CDED7-448B-4801-B57D-=20 > > > B19483EC606F HddPassword > > > HddPasswordDxeInit(): Lock HddPassword variable (Success) > > > > > > > > > After > > > > > > InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B > > > 67EA1370 > > > InstallProtocolInterface: 330D4706-F2A0-4E4F-A369-B66FA8D54385 > > > 68153DB0 > > > HddPasswordDxeInit(): Lock HddPassword variable (Success) > > > > > > > > > Thanks > > > > > > > > > > > > -----Original Message----- > > > From: Yao, Jiewen > > > Sent: Wednesday, May 3, 2023 12:11 AM > > > To: Liu, Linus ; devel@edk2.groups.io > > > Cc: FST-FIR-PRC ; FST FIR Server=20 > > > ; Chu, Maggie > > > Subject: RE: [PATCH] Securitypkg/hddpassword: Update=20 > > > HddPasswordDxeInit to use Variable Policy > > > > > > Thanks. The patch loos good to me. > > > > > > Would you please share with us, how you validate the patch? > > > > > > > > > > > > > -----Original Message----- > > > > From: Liu, Linus > > > > Sent: Tuesday, April 11, 2023 5:55 PM > > > > To: devel@edk2.groups.io > > > > Cc: Yao, Jiewen ; FST-FIR-PRC > > > prc@intel.com>; FST FIR Server ; Chu,=20 > > > > Maggie > > > > Subject: [PATCH] Securitypkg/hddpassword: Update > HddPasswordDxeInit > > > to > > > > use Variable Policy > > > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4408 > > > > > > > > Change-Id: I3c4b466ef318766d6d70c9f73e36b94b5f10832c > > > > Cc: Jiewen Yao > > > > Cc: FST-FIR-PRC > > > > Cc: FST FIR Server C > > > > Cc: Maggie Chu > > > > Signed-off-by: Linus Liu > > > > --- > > > > SecurityPkg/HddPassword/HddPasswordDxe.c | 16 +++++++++++----- > > > > SecurityPkg/HddPassword/HddPasswordDxe.h | 1 - > > > > SecurityPkg/HddPassword/HddPasswordDxe.inf | 3 ++- > > > > SecurityPkg/SecurityPkg.dsc | 1 + > > > > 4 files changed, 14 insertions(+), 7 deletions(-) > > > > > > > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c > > > > b/SecurityPkg/HddPassword/HddPasswordDxe.c > > > > index a1a63b67a4..c20fdbe83f 100644 > > > > --- a/SecurityPkg/HddPassword/HddPasswordDxe.c > > > > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c > > > > @@ -9,6 +9,7 @@ > > > > **/ > > > > > > > > > > > > > > > > #include "HddPasswordDxe.h" > > > > > > > > +#include > > > > > > > > > > > > > > > > EFI_GUID mHddPasswordVendorGuid =3D > > > > HDD_PASSWORD_CONFIG_GUID; > > > > > > > > CHAR16 mHddPasswordVendorStorageName[] =3D > > > > L"HDD_PASSWORD_CONFIG"; > > > > > > > > @@ -2822,7 +2823,7 @@ HddPasswordDxeInit ( > > > > HDD_PASSWORD_DXE_PRIVATE_DATA *Private; > > > > > > > > VOID *Registration; > > > > > > > > EFI_EVENT EndOfDxeEvent; > > > > > > > > - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock; > > > > > > > > + EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; > > > > > > > > > > > > > > > > Private =3D NULL; > > > > > > > > > > > > > > > > @@ -2858,12 +2859,17 @@ HddPasswordDxeInit ( > > > > // > > > > > > > > // Make HDD_PASSWORD_VARIABLE_NAME variable read-only. > > > > > > > > // > > > > > > > > - Status =3D gBS->LocateProtocol=20 > > > > (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **)&VariableLock); > > > > > > > > + Status =3D gBS->LocateProtocol=20 > > > > + (&gEdkiiVariablePolicyProtocolGuid, > > > > + NULL, > > > > (VOID **)&VariablePolicy); > > > > > > > > if (!EFI_ERROR (Status)) { > > > > > > > > - Status =3D VariableLock->RequestToLock ( > > > > > > > > - VariableLock, > > > > > > > > + Status =3D RegisterBasicVariablePolicy ( > > > > > > > > + VariablePolicy, > > > > > > > > + &mHddPasswordVendorGuid, > > > > > > > > HDD_PASSWORD_VARIABLE_NAME, > > > > > > > > - &mHddPasswordVendorGuid > > > > > > > > + VARIABLE_POLICY_NO_MIN_SIZE, > > > > > > > > + VARIABLE_POLICY_NO_MAX_SIZE, > > > > > > > > + VARIABLE_POLICY_NO_MUST_ATTR, > > > > > > > > + VARIABLE_POLICY_NO_CANT_ATTR, > > > > > > > > + VARIABLE_POLICY_TYPE_LOCK_NOW > > > > > > > > ); > > > > > > > > DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n",=20 > > > > __FUNCTION__, HDD_PASSWORD_VARIABLE_NAME, Status)); > > > > > > > > ASSERT_EFI_ERROR (Status); > > > > > > > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.h > > > > b/SecurityPkg/HddPassword/HddPasswordDxe.h > > > > index 231533e737..049a208794 100644 > > > > --- a/SecurityPkg/HddPassword/HddPasswordDxe.h > > > > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.h > > > > @@ -17,7 +17,6 @@ > > > > #include > > > > > > > > #include > > > > > > > > #include > > > > > > > > -#include > > > > > > > > > > > > > > > > #include > > > > > > > > #include > > > > > > > > diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.inf > > > > b/SecurityPkg/HddPassword/HddPasswordDxe.inf > > > > index 06e8755ffc..2c0ebbcc78 100644 > > > > --- a/SecurityPkg/HddPassword/HddPasswordDxe.inf > > > > +++ b/SecurityPkg/HddPassword/HddPasswordDxe.inf > > > > @@ -50,6 +50,7 @@ > > > > PrintLib > > > > > > > > UefiLib > > > > > > > > LockBoxLib > > > > > > > > + VariablePolicyHelperLib > > > > > > > > S3BootScriptLib > > > > > > > > PciLib > > > > > > > > BaseCryptLib > > > > > > > > @@ -63,7 +64,7 @@ > > > > gEfiHiiConfigAccessProtocolGuid ## PRODUCES > > > > > > > > gEfiAtaPassThruProtocolGuid ## CONSUMES > > > > > > > > gEfiPciIoProtocolGuid ## CONSUMES > > > > > > > > - gEdkiiVariableLockProtocolGuid ## CONSUMES > > > > > > > > + gEdkiiVariablePolicyProtocolGuid ## CONSUMES > > > > > > > > > > > > > > > > [Pcd] > > > > > > > > gEfiSecurityPkgTokenSpaceGuid.PcdSkipHddPasswordPrompt ## > > > CONSUMES > > > > > > > > diff --git a/SecurityPkg/SecurityPkg.dsc=20 > > > > b/SecurityPkg/SecurityPkg.dsc index 3bad5375c0..3c62205162=20 > > > > 100644 > > > > --- a/SecurityPkg/SecurityPkg.dsc > > > > +++ b/SecurityPkg/SecurityPkg.dsc > > > > @@ -74,6 +74,7 @@ > > > > > > > > > PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibV > > > > PlatformPKProtectionLib|ar > > > > PlatformPKProtectionLib|Po > > > > licy/PlatformPKProtectionLibVarPolicy.inf > > > > > > > > > > > > > SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariabl > > > > SecureBootVariableProvisionLib|eP ro > > > > visionLib/SecureBootVariableProvisionLib.inf > > > > > > > > TdxLib|MdePkg/Library/TdxLib/TdxLib.inf > > > > > > > > + > > > > > VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib > > > > VariablePolicyHelperLib|/V > > > > VariablePolicyHelperLib|ar > > > > iablePolicyHelperLib.inf > > > > > > > > > > > > > > > > [LibraryClasses.ARM, LibraryClasses.AARCH64] > > > > > > > > # > > > > > > > > -- > > > > 2.33.1.windows.1 >=20 >=20 >=20 >=20 >=20 --_002_PH7PR11MB58885ECFEF0C6FDA63C074E4FC719PH7PR11MB5888namp_ Content-Type: message/rfc822 Content-Disposition: attachment; creation-date="Mon, 08 May 2023 01:08:34 GMT"; modification-date="Mon, 08 May 2023 01:08:40 GMT" Received: from SA0PR11MB4637.namprd11.prod.outlook.com (2603:10b6:806:97::16) by PH7PR11MB5888.namprd11.prod.outlook.com with HTTPS; Fri, 28 Apr 2023 02:56:01 +0000 Received: from BN9PR03CA0441.namprd03.prod.outlook.com (2603:10b6:408:113::26) by SA0PR11MB4637.namprd11.prod.outlook.com (2603:10b6:806:97::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.22; Fri, 28 Apr 2023 02:56:00 +0000 Received: from BN1NAM02FT027.eop-nam02.prod.protection.outlook.com (2603:10b6:408:113:cafe::b6) by BN9PR03CA0441.outlook.office365.com (2603:10b6:408:113::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.23 via Frontend Transport; Fri, 28 Apr 2023 02:56:00 +0000 Received: from edgegateway.intel.com (134.134.137.102) by BN1NAM02FT027.mail.protection.outlook.com (10.13.2.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.22 via Frontend Transport; Fri, 28 Apr 2023 02:56:00 +0000 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by edgegateway.intel.com (10.7.248.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 27 Apr 2023 19:55:53 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 27 Apr 2023 19:55:53 -0700 Received: from orsmga002.jf.intel.com (10.7.209.21) by orsmsx602.amr.corp.intel.com (10.22.229.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Thu, 27 Apr 2023 19:55:53 -0700 Received: from linusliu-desk1.gar.corp.intel.com ([10.5.215.134]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2023 19:55:52 -0700 From: "Liu, Linus" To: "devel@edk2.groups.io" CC: "Liu, Linus" , "Yao, Jiewen" , "Chu, Maggie" , "Kumar, Rahul R" Subject: [PATCH v1] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy Thread-Topic: [PATCH v1] Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy Thread-Index: AQHZeXz3RXnN9bLXVUysNhhID6lvaQ== Date: Fri, 28 Apr 2023 02:55:43 +0000 Message-ID: <20230428025543.127-1-linus.liu@intel.com> Content-Language: en-US X-MS-Exchange-Organization-AuthMechanism: 10 X-MS-Exchange-Organization-AuthSource: ORSMSX602.amr.corp.intel.com X-MS-Exchange-Organization-ComplianceLabelId: 12ee4da9-25d2-4141-a122-b55133cf49dd X-MS-Has-Attach: X-MS-Exchange-Organization-Network-Message-Id: a9399e21-7c58-4102-e553-08db479418f3 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 x-ms-exchange-organization-originalclientipaddress: 10.7.209.21 x-ms-exchange-organization-originalserveripaddress: 10.13.2.141 received-spf: Fail (protection.outlook.com: domain of intel.com does not designate 134.134.137.102 as permitted sender) receiver=protection.outlook.com; client-ip=134.134.137.102; helo=edgegateway.intel.com; x-ms-publictraffictype: Email X-Microsoft-Antispam-Mailbox-Delivery: ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(425001)(930097); X-Microsoft-Antispam-Message-Info: gzaKr8ifXWqd3sjlyAcNjoipuTolk7EQFpTmEPDIPaD0BuH8a+NGLHbJFfijzjJgQrmJvY9dSvNKKnHP1TEMJOtnXVd/2Lwt+GstYxxiCX0p9vl7AURpn5T2WJw7HHhrqqkPK6yAdPg2UF4geee4/aYSU9A8jmC2fn1KzXKAgZh+MccwrYr/y3tegy5k0IjWi9FoiLy2jhxdmO9q9cCPxj6UwqwT/AxxBrkUIp0UiP9NU+gsaEEYClI2HQGg7RwywVCP6KAtx74KsXIdKiqbzh3N/T+pcmYkIWy3eX7eq1lJ8FmQl+ac0KkW2ZOUlknRpNHybJeeZsdUHbj9j3xVs4f1hSLGwd1Rs2THFEKrG1KWO8hxi4wWcbWMl+8G4mhEc5Pf67lKj+r1EHhNrqudVL15RrEzii6lIloNcwkkq64Nepn8DYu2GBwSQAz9PTiFTGe3A1FDjR8BjvLIGZ/y+Ftxe9wWBnGWo4urRqb7E/XmG4YEtbwVDDnC74hrxh4U/PHE6/do7LRalyLlcHbD8SziLIQk1EohPq/6utQnpbikZLHg/tZ+QvPBAhslle52wgmcXb0G4+7JdS4W/PyEyM0v2jZDaZxGPxeJ+nJH+nEaxLSwRR68kmgmnRlbztYRzRDqbaLqPOLl+jWNj+8oQ7uV6Oisc4jmZFxkua9jjAk= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: Linus Liu REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4408 Cc: Jiewen Yao Cc: Maggie Chu Cc: Kumar Rahul Signed-off-by: Linus Liu --- SecurityPkg/HddPassword/HddPasswordDxe.c | 20 +++++++++++++------- SecurityPkg/HddPassword/HddPasswordDxe.h | 1 - SecurityPkg/HddPassword/HddPasswordDxe.inf | 3 ++- SecurityPkg/SecurityPkg.dsc | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPass= word/HddPasswordDxe.c index 55dfb25886..86c11c749f 100644 --- a/SecurityPkg/HddPassword/HddPasswordDxe.c +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c @@ -9,6 +9,7 @@ **/ #include "HddPasswordDxe.h" +#include EFI_GUID mHddPasswordVendorGuid =3D HDD_PASSWORD_CONFIG_GUID; CHAR16 mHddPasswordVendorStorageName[] =3D L"HDD_PASSWORD_CONFIG"; @@ -2822,7 +2823,7 @@ HddPasswordDxeInit ( HDD_PASSWORD_DXE_PRIVATE_DATA *Private; VOID *Registration; EFI_EVENT EndOfDxeEvent; - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock; + EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; Private =3D NULL; @@ -2858,13 +2859,18 @@ HddPasswordDxeInit ( // // Make HDD_PASSWORD_VARIABLE_NAME variable read-only. // - Status =3D gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (= VOID **)&VariableLock); + Status =3D gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL,= (VOID **)&VariablePolicy); if (!EFI_ERROR (Status)) { - Status =3D VariableLock->RequestToLock ( - VariableLock, - HDD_PASSWORD_VARIABLE_NAME, - &mHddPasswordVendorGuid - ); + Status =3D RegisterBasicVariablePolicy ( + VariablePolicy, + &mHddPasswordVendorGuid, + HDD_PASSWORD_VARIABLE_NAME, + VARIABLE_POLICY_NO_MIN_SIZE, + VARIABLE_POLICY_NO_MAX_SIZE, + VARIABLE_POLICY_NO_MUST_ATTR, + VARIABLE_POLICY_NO_CANT_ATTR, + VARIABLE_POLICY_TYPE_LOCK_NOW + ); DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __func__, HDD_PAS= SWORD_VARIABLE_NAME, Status)); ASSERT_EFI_ERROR (Status); } diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.h b/SecurityPkg/HddPass= word/HddPasswordDxe.h index 231533e737..049a208794 100644 --- a/SecurityPkg/HddPassword/HddPasswordDxe.h +++ b/SecurityPkg/HddPassword/HddPasswordDxe.h @@ -17,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.inf b/SecurityPkg/HddPa= ssword/HddPasswordDxe.inf index 06e8755ffc..2c0ebbcc78 100644 --- a/SecurityPkg/HddPassword/HddPasswordDxe.inf +++ b/SecurityPkg/HddPassword/HddPasswordDxe.inf @@ -50,6 +50,7 @@ PrintLib UefiLib LockBoxLib + VariablePolicyHelperLib S3BootScriptLib PciLib BaseCryptLib @@ -63,7 +64,7 @@ gEfiHiiConfigAccessProtocolGuid ## PRODUCES gEfiAtaPassThruProtocolGuid ## CONSUMES gEfiPciIoProtocolGuid ## CONSUMES - gEdkiiVariableLockProtocolGuid ## CONSUMES + gEdkiiVariablePolicyProtocolGuid ## CONSUMES [Pcd] gEfiSecurityPkgTokenSpaceGuid.PcdSkipHddPasswordPrompt ## CONSUMES diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc index 3bad5375c0..3c62205162 100644 --- a/SecurityPkg/SecurityPkg.dsc +++ b/SecurityPkg/SecurityPkg.dsc @@ -74,6 +74,7 @@ PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPo= licy/PlatformPKProtectionLibVarPolicy.inf SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariablePro= visionLib/SecureBootVariableProvisionLib.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf [LibraryClasses.ARM, LibraryClasses.AARCH64] # -- 2.39.2.windows.1 --_002_PH7PR11MB58885ECFEF0C6FDA63C074E4FC719PH7PR11MB5888namp_--