From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.51]) by mx.groups.io with SMTP id smtpd.web09.8591.1657810787185354682 for ; Thu, 14 Jul 2022 07:59:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=iTpa/7vy; spf=pass (domain: arm.com, ip: 40.107.15.51, mailfrom: sunny.wang@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=YslrT7gw1fFbH2gcmFDoFY9R2slLHWotkvTJUQZ0MS39/f5lH3T3hcLV9cMQGlYFXEQMqR7LAt0uc5xEO4hd07iN7BN/+y6zrN61kCXxXNHjjjJZH/Rk4MxkcSAa511VHSPwVN1OIafUwjfRxnxamz1Fq47+dHUXWGKV1gtjrzmBFxmDbAD0sVOX0GhYm1GH1OZBvuRtYtsIDCKzv9eUxa5raov9L7XcR4e/+9UjDm29BCgQKJpCrS1Gn/EHFUQFj4b6DFouA8VOINtjdMtHod8vBdiJ4dlgnovZKAf06lAdL/RyHEDoe0emE8Y3VEViy84AIgoU2zdjMi5KNlSP5w== ARC-Message-Signature: i=2; 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=8c46fKhtTVCwjSq7U8CHOMTeTUhgWfBJZ6h307a+Fm8=; b=EQdzkLguvbkjIYqISD3dnzB1yajWUhMul8MFh1kLx9rZksvohcSCp/15plNgJPcYOmgGCONLT5/9+rF/8i6b43GukjqdVPfnJWiPJlvaikmGQLnq1f/AmaBG6RgR3F3ByFvx+b0laOBP79L+BP4Gm7RxiDAsylDtNGcM60adgne5wx3H+VxKINwBnGPisnWy1wz+HragxxcNCnWY2NJRj48mooSd6CskaGwF+uDwtTQaxi9i7op1AMcfFrEdjgCE+yPzbxAr+itaSUEweShU1uTYbLLJOjDIDQhIBs/G9xJw60uzDeZ9zfHt+6Hxnyl7B2hJxcDM37WAjmx8NnX5LQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8c46fKhtTVCwjSq7U8CHOMTeTUhgWfBJZ6h307a+Fm8=; b=iTpa/7vyqpaZ3VSEoyPeiw9l1kKrqQChRSs69wUqLrSWJPYfb8Q/l2JLsV9gUa5KSnkFpvwmOH+PjVxFb1n3TkTDnFl7D6OhYOejAMfVVLVJ5Xl4GEFe7H57BJW2S0437WL2/YsbYwSLjwmvrlEkDFJAWoT+5uHjiP4IRK/dJws= Received: from DU2PR04CA0237.eurprd04.prod.outlook.com (2603:10a6:10:2b1::32) by AM6PR08MB4486.eurprd08.prod.outlook.com (2603:10a6:20b:72::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21; Thu, 14 Jul 2022 14:59:44 +0000 Received: from DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b1:cafe::f1) by DU2PR04CA0237.outlook.office365.com (2603:10a6:10:2b1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15 via Frontend Transport; Thu, 14 Jul 2022 14:59:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT025.mail.protection.outlook.com (100.127.142.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 14:59:43 +0000 Received: ("Tessian outbound e5f49c5d38f9:v122"); Thu, 14 Jul 2022 14:59:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 71b937e619c8e11a X-CR-MTA-TID: 64aa7808 Received: from f662bf30387a.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 02F09F28-A1AF-4B91-8A89-EFE1A128E296.1; Thu, 14 Jul 2022 14:59:33 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f662bf30387a.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 14:59:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=luhahbaVke3wWF2PNU6bG7Mgf5yRalYyVnNCwj/eVHNpzsNDtL4wYYI1XDZ/oKq+zUy0BmydP7PfTBZb897SEKyOKbVDhJFpibJagJl0yI6gEi7abKGWbhVXnSn9TcaPB5vUBKnYxxuu5zeg7j6xTDSVcsb0Ik97kTLl3Hg46hw5fJ9kFy9biyYkPilM59yGcMBSwXRM0ENmtzXqlQBXfBJcL2zbHNmBd807pDSizrECbPC0udLvnwDhjf+d4KqElqRAW5LInGCVnclumVVIWR449OJYYtYCfawfMdjPJASq5VRhzHmQJMYCUj6LFuMgW2hef9IVKlgc+XMcmcW3wQ== 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=8c46fKhtTVCwjSq7U8CHOMTeTUhgWfBJZ6h307a+Fm8=; b=kd8fOzIX1hSEPaDEHDfkdNDLL6ujZWjeZGUR6CO6LPKUD5mK6ADrzahl8rYfeI5tjiEe7EnrN3dBvqAukkxHFIt+TT15RFOlun4ilNlW4vfoMYBDm4DlnR7DMlypwR0pp8sTTFnAsvZ0/OsBKesWbFP+IrxwYMKf6KprYQRz9ZiQRVULatQZooCnsLf031mnntRWyv2kplRT1qKBUjh/eehCWYIsyVuJvqVxYgtXn9G+mFpPK7mCX+6YUkn511gah8J5t1Do2tIWNknJWliJ3mpY8aGSJEwYYQ07tHZHqhArvncZ0w8MCLEMZIHpWiFPCsm/27rM3bLnOq3O9sSfqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8c46fKhtTVCwjSq7U8CHOMTeTUhgWfBJZ6h307a+Fm8=; b=iTpa/7vyqpaZ3VSEoyPeiw9l1kKrqQChRSs69wUqLrSWJPYfb8Q/l2JLsV9gUa5KSnkFpvwmOH+PjVxFb1n3TkTDnFl7D6OhYOejAMfVVLVJ5Xl4GEFe7H57BJW2S0437WL2/YsbYwSLjwmvrlEkDFJAWoT+5uHjiP4IRK/dJws= Received: from AS8PR08MB7791.eurprd08.prod.outlook.com (2603:10a6:20b:52d::6) by PAXPR08MB7004.eurprd08.prod.outlook.com (2603:10a6:102:203::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Thu, 14 Jul 2022 14:59:31 +0000 Received: from AS8PR08MB7791.eurprd08.prod.outlook.com ([fe80::f53a:a7c8:f845:4b37]) by AS8PR08MB7791.eurprd08.prod.outlook.com ([fe80::f53a:a7c8:f845:4b37%7]) with mapi id 15.20.5417.023; Thu, 14 Jul 2022 14:59:30 +0000 From: "Sunny Wang" To: xueshengfeng , "devel@edk2.groups.io" CC: "gaoliming@byosoft.com.cn" , G Edhaya Chandran , Samer El-Haj-Mahmoud , Lijun10x , Sunny Wang Subject: Re: [PATCH] MdeModulePkg/Variable: SCT run AuthVar_conf is failed Thread-Topic: [PATCH] MdeModulePkg/Variable: SCT run AuthVar_conf is failed Thread-Index: AQHYj4zit6nT0gqdL0SE0wtjtNtaTK1+AnOA Date: Thu, 14 Jul 2022 14:59:29 +0000 Message-ID: References: <7d6c057e3c99869d75dd11d3a77671a3ec33ef2e.1656642493.git.junx1.li@intel.com> In-Reply-To: <7d6c057e3c99869d75dd11d3a77671a3ec33ef2e.1656642493.git.junx1.li@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 25d7f2f2-bb38-44d3-a68c-08da65a97c82 x-ms-traffictypediagnostic: PAXPR08MB7004:EE_|DBAEUR03FT025:EE_|AM6PR08MB4486:EE_ x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: RIEek2eDXVn3n1KrrkUHHiMHW7gDgrPq8COoOkMNY/mS/wUs0bPjRNbG5BeL3niUh7+qJ6norYO1XHBatduKFzzVn30ZcQ8Gn/bDxNCDtw6cFc1bDapBEMKHn3tS78yyz5z6YSWrWYj96G+la8y58CiW3DphL4tmmG4qrkWo9xq3ipY9M1ZuNRE60eJkvFnjU1TvCpmbQFV+aAH7aYgovUKcMNbM20Woj8VJ85zd9qVZ9OUxmoN3G1hPb6BREgrFSCrbj7+js/IklsMh02KzLRXH4kso7HsHRrkqVjs1768yrMOItxjNyyV3lMYA2vRg6EJdX93JZznhDo20ibekqJOkbIjaNiOWhus2DI5erdJAU94uz9uDfsOzCPIpC9pmVVES7rnEaJ0b5qN9Xe9wnWu8D+ZXdZND+cjR1Eiw9jIWK5ntIRdgPKriTP0bEz4iTWS/OnFwDHf809xU2XJQfWn5H8M77wcatJRaSuSBJVC2mhY6S0FjFCYiIo59MBRBd3g2+rhvIWnh054BjJfc/28QmGKhaKasdmoaWovCipX4CMxzS+7LNNBPAQXjwPL+Q1zY556Wp7R93Gj7WbrPoRID5BJC+DIgDwnJPTflvD+xEaFPQD3r9caL/wgmC7rOGcAbp8vytXb29hbYFvCV2eietfYxDZbcOLLX7D6WBt+CoFAAQGZFu50OnKLL7Y+FCi4fGopukIfnHkGtnxiB8/5/WIS10G2MuKx4aTQZhvhhTjCyLb9mTc7Qhi+uf6/Xz87jxYS/fI4IOFPBSAp5lnUvng3yvffM920oS+kWhU0B+ma4Vmetwq0DB9vm5uq859EMSZMTUc0pjTAZncXCPfnvjavNfGkaQwgtXzDv+sJ73QW+5J34gRa9EoQhB3ZNYEMFlM1Ngh5vNpaEOtST/Q== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7791.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(39860400002)(346002)(136003)(366004)(396003)(54906003)(86362001)(41300700001)(38100700002)(38070700005)(110136005)(8676002)(2906002)(76116006)(4326008)(66446008)(66556008)(66946007)(64756008)(66476007)(83380400001)(52536014)(7696005)(478600001)(33656002)(53546011)(9686003)(6506007)(71200400001)(26005)(5660300002)(122000001)(55016003)(316002)(186003)(8936002);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7004 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sunny.Wang@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8d90d4c1-6bb7-4103-df45-08da65a973e8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RYeT3ujNg3EncAaxf1mw3wUC5LDgJ1hDP/LcfKaGyxFQbQe+nZjlQ8nN/7alvOL71Df4ldQVL3zpRj2Ebnm6EoYehhAopBZjeNhl9rLWxoeALUdLwT1nndTOAw2YVl3Twr8Ps2mPlLyHvniUMsFX31NlTE2beLqpdbYOR+FS+9idtW57BP/3qbb+AD92543XDhWETGhPWSmn4ybEXIVBVXwxvjSQtcimBKLc80fe5S+0blxE9JIcPflmvRJCmE1C3HdRluPEjAwwee3/1+X4krPIq7rLDoRmFcjkmZBXfHhcx0jpkxC9BAdCoOzjH544xhwkeIfIb/BG6k1xVbEUFtakR/RRBsbT/X2Os8tze88zB9P69H5f+pRKvDqtUDAZUGgvoEj/EsitrtCK4VivBPeMcLWDaOhu14Vq4R8Wv6Hv7usXLb0okNJg7F59vMUa5O+24sHNEZm9aQMtMM9kb/W6oSeyXxRfQuRy58cL0zoFW4C6vQIMIFgzgLlc1nN7tU7XhzK8gAkez5pkGBwaDBR26a+mrFA0S1K7B3IbF5tSKen56qPEu2VKMx0U3pb1a6da6Y1S0gGRpA2zLmIs4A/UqpPGwJd2ZzNIYikwbPXpNJe6bGK591kEOh3KCwuDc/4/gRfLypQrA9/Qq93WicjmFzXIacvRDEes4qeQwnBxIcs4NjXRboo/ajEGgKmmNG/PXqH4gpMrB+OSUVeFxQBbgP/Xv7cBAsM08BuaxAbE2+X9A13845BVCFruJ+VuzoI1o4Wqn988QqjtB2lQj4cg/RxOpywrFp308vruXCOHQqC3/7DHfrN725AQCtsbZ3pptnsVp8DER8uucHS3h8vj5rQpUTfc5s4JlrG26AE= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(376002)(346002)(396003)(39860400002)(136003)(36840700001)(40470700004)(46966006)(186003)(2906002)(9686003)(40460700003)(4326008)(53546011)(70206006)(26005)(70586007)(47076005)(8676002)(82740400003)(478600001)(81166007)(336012)(83380400001)(6506007)(86362001)(82310400005)(356005)(52536014)(54906003)(36860700001)(316002)(55016003)(7696005)(8936002)(5660300002)(41300700001)(40480700001)(33656002)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 14:59:43.9005 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25d7f2f2-bb38-44d3-a68c-08da65a97c82 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4486 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ah.. good catch. I was not aware that EFI_VARIABLE_ATTRIBUTES_MASK doesn't = include EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS bit. Thanks for fixing the issue, JunX1 Li and xueshengfeng. Moreover, I assumed that you haven't got Edhaya's and Samer's review, right= ? If so, you should use "Cc:" instead of "Reviewed-by:" in your commit mess= age. The code change looks good to me. Reviewed-by: Sunny Wang -----Original Message----- From: xueshengfeng Sent: 04 July 2022 11:00 To: devel@edk2.groups.io Cc: gaoliming@byosoft.com.cn; G Edhaya Chandran ; = Samer El-Haj-Mahmoud ; Sunny Wang ; Lijun10x Subject: [PATCH] MdeModulePkg/Variable: SCT run AuthVar_conf is failed From: Lijun10x REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3969 Attr are EFI_VARIABLE_NON_VOLATILE|VARIABLE_AUTHENTICATED_WRITE_ACCESS, will return EFI_INVALID_PARAMETER. Added one case, only when one attribute is EFI_VARIABLE_NON_VOLATILE will EFI_INVALID_PARAMETER be returned. If attr are EFI_VARIABLE_NON_VOLATILE|VARIABLE_AUTHENTICATED_WRITE_ACCESS will return EFI_UNSUPPORTED. In the UEFI2.7 spec, there is a description as below: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should not be used. Platforms should return EFI_UNSUPPORTED if a caller to SetVariable() specifies this attribute. Signed-off-by: JunX1 Li Reviewed-by: Liming Gao Reviewed-by: G Edhaya Chandran Reviewed-by: Samer El-Haj-Mahmoud Reviewed-by: Sunny Wang --- MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeMod= ulePkg/Universal/Variable/RuntimeDxe/Variable.c index 6c1a3440ac..14c176887a 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -2676,7 +2676,11 @@ VariableServiceSetVariable ( // // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid // - return EFI_INVALID_PARAMETER; + if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) !=3D 0) { + return EFI_UNSUPPORTED; + } else { + return EFI_INVALID_PARAMETER; + } } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) !=3D 0) { if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) { // -- 2.26.2.windows.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.