From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by mx.groups.io with SMTP id smtpd.web10.594.1601933330327252270 for ; Mon, 05 Oct 2020 14:28:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=X6cDpSRR; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 216.228.121.65, mailfrom: jbrasen@nvidia.com) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 05 Oct 2020 14:28:37 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 5 Oct 2020 21:26:16 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.58) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 5 Oct 2020 21:26:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dVFin5eWM4cZYsET9W9S/hVAnNT9vx8SKf9gRvJfmJD1f2w9BmF1wFfjr9bLyW3ApphExF7+WDtEufUIMGBh/OZFSkmZxAupbns+JRLJsW+ZkhxGKjF9x/AGfyaxI83CAlojajLV+uBHSRKgsWw0KMqYyl9HjPO+edRgNa9xcO+CPGOWBeh0TmJcplUFPqwd5twDfRjhJU8P2uwsIrJaAykRZMk/ODVotUuqJK213o/7zAyHGpzezFzeXw6Ra4y3j31xo+C/f9VzGVOJfQfBD0uqmHkRE2IjI3OS90N4hz3c4c+Rp1Donmg/Awb94l9Np/wz9jFOhpWLh7swKqOsjQ== 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=PknYV6iTs+v06IwfB6ctLxVR9/egOo4II4wAAvxWWuQ=; b=Nd5OAiGE/xKSM/zUFgFkq+NAU2GJ1s3IecIPEL90rRmjDfql9Qs0mWVrsu7Kz06jnAUO2cwsMObsKEU5KAtqGVR7jCyd0ym0FlVS+tlMnNYZE4qmkuGXhe/2eokLhqm9n+X1AEHzuZBuROTIFEtotT7EvCTliwHCd/nk3iMsDF9UZh3CPIk40WCaoN0ev/qOmPhBuv+Ugn2mg+zRWgpvBk0jAWjgVlX+3k4GIOjDxijl+pfubsE0rOC1e4iLsPBMFCW6PIU/YCoBGwqnyRFdkkjZdk6yKfMlnl5SeaokJRWAwB2Fw5B59i/Fl9sfMolmmVY2vej+sl9v2EslxQf8kA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB3340.namprd12.prod.outlook.com (2603:10b6:5:3d::24) by DM5PR12MB1289.namprd12.prod.outlook.com (2603:10b6:3:79::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.36; Mon, 5 Oct 2020 21:26:15 +0000 Received: from DM6PR12MB3340.namprd12.prod.outlook.com ([fe80::ec28:f0f5:ee3f:8077]) by DM6PR12MB3340.namprd12.prod.outlook.com ([fe80::ec28:f0f5:ee3f:8077%4]) with mapi id 15.20.3433.044; Mon, 5 Oct 2020 21:26:15 +0000 From: "Jeff Brasen" To: Samer El-Haj-Mahmoud , "devel@edk2.groups.io" , Laszlo Ersek CC: "eric.jin@intel.com" , G Edhaya Chandran Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled. Thread-Topic: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled. Thread-Index: AQHWiGBbN7IwCEvN9EeKUFCsDYJgF6l1SmF/gAC0h4CAAHQoEYAJT1AAgAnpFdA= Date: Mon, 5 Oct 2020 21:26:15 +0000 Message-ID: References: <4d637a44c99f0aaa8d78b2def96114d7dc3b1bb6.1599844750.git.jbrasen@nvidia.com> ,<5fedff50-5a4b-e57a-055f-794d071eac86@redhat.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=jbrasen@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2020-10-05T21:26:13.1311880Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_ActionId=a32f3f4c-42a6-472a-9b05-3056763ed636; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [2601:281:8100:1241:45fd:eb42:e3ad:d078] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 849be4f3-dd50-41b0-8ed6-08d869754a5d x-ms-traffictypediagnostic: DM5PR12MB1289: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BaZdYEaNClzarDPncOeAcwQnMR+1EB+I9mPjUKDYMrDWtROnHwzvCBPGgyX7lfFva9pgADEBfU0H5ortrh3K77qW4VQCZgwhpwBxG+eG2s77AQT0q1UxVSM1xPJX0NsTTLyqBteKjzyoW1IS/r2Mlqgc+lCd0zQ2znbA+eX6rglEvL3X+FojYnFCPImOk0DQFp3kXAocvPpadQGmeJeamaaNiiX1yaL1uqa4w8+9jlat4dWmc6wkwfye4MvmVF7zDLkfuOOQRyB7yDG8J5Zoqfy+2sNqHaHjc2pBoamr3Y81CpA8Ficp9LZu4RVBw3MrORAH2hHEIqXdj8KIpSRfPbdxyY7SLVcofhmpECNOu1wrt4QLR+dbywJtjgViY5ZuSmJrcFdwD4NHZzJpM3p7jQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3340.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(376002)(136003)(366004)(346002)(396003)(76116006)(64756008)(55016002)(54906003)(66946007)(66556008)(76236003)(66476007)(316002)(66446008)(2906002)(9686003)(83080400001)(110136005)(83380400001)(71200400001)(478600001)(53546011)(33656002)(86362001)(8936002)(30864003)(4326008)(166002)(7696005)(6506007)(8676002)(186003)(5660300002)(52536014);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: xgdgWpxe5LPoD5jdpXUYeZY/jNky1Ru4y3l8cyOpFfqViagSgbw9f+c8fsz+nl8KEbx1/qMoCpPIp46JvmdxJ8seD8yHjOm/t+HiiQhigfUqlkQM28NtlZXqDjXQgvndrfzWFvZ2heUPjXn//KeLVBRwFeRxtrnvcwWJzxRkXjd0F+2iCS2MVlPaSGFaARJhEcBnJKTle3FGHqwy2ahNOttUDqlWYM3h2uiIT3CtUL9lbeIxK+oqfx/El+JhfkfX2Kyu0Zbu5eMHJRvv5X9fjDuTKtwqwiNkw4ZQmfU70rEJhykghvf9R/LrUUMJt3PjUS9vrp5lj5Z5fzy9lhocvEhul2RgRudLU/J7JYjMbT+BFjW3RnsIuf3gwPhK3BG+Ox+OPAjgJU6gWGS2IETVY+rEB1KyEcyMN///issoV/NQfAOkF9iu53lkLgWgx6xdETkioSrdpYK6zyE7BRzdMDhtBii9VmDttbhG9q4rREfA1iB+yTDlNcGvjYWCINfIzjcUNXHmgV8x7Z2lLCRtFBldfGydtISLHayNlYJLwy+NCJfPpnJeF16p0sIzznd5SXTO4eLYELAoiuo9NCNsG5DmYfBn6ofEDyq86KQI93dqHyxZkL4PNTkrVzDxHLhE64YSKLcQiZDBaYipkP0yM4h7LUkoa10y2MEkP7TWEC/n9QlTA1uq6nXh2TaI3VsFPOSHnTTuOLop5oooJnqRRQ== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3340.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 849be4f3-dd50-41b0-8ed6-08d869754a5d X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2020 21:26:15.1211 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Q0UBLFtHGSNjE57j6tstVQ9qVLicOLMreTEyxN4PVglyhdnl96c/mHa1vRDSCeTAJT0yNe8HHq/vgHzGJAeQZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1289 Return-Path: jbrasen@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601933317; bh=PknYV6iTs+v06IwfB6ctLxVR9/egOo4II4wAAvxWWuQ=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:msip_labels:authentication-results: x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-ms-traffictypediagnostic: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:x-ms-exchange-transport-forked: Content-Type:MIME-Version:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=X6cDpSRR3ke13DXnLBcLztMLuYrW/T+iJ5EFxtoO1TUoHjIQjVUEP0nxR+WsYn7QN Rf1Zgiw50UqazILY93zw6ZoOoQsfix1w6YBsRrixnE88yQPdZPHj5etXJ7/kZZUD8T BEpBmrFFUPObUXOroztS0NAC4lK8XVA0jjL4T/IKHVcgSEvWSH/II9QnaCAPm9MmCd FuhvjlLXjfMe4eCMu1Frx+t+7CnzIHwKlxP2Y636kKHnQrlRyPB2yamVH9IthUfiCS fBYtn0AT+9xrjDeXGXveTYwBh1Crf9/LoerI74OofinVvq/ibrlqtSfjLluQDZYQth dqhR4+VVPZJSw== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR12MB3340D676F270D5ED35F3349DCB0C0DM6PR12MB3340namp_" --_000_DM6PR12MB3340D676F270D5ED35F3349DCB0C0DM6PR12MB3340namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Are we looking for any other reviews on this? Thanks, Jeff From: Samer El-Haj-Mahmoud Sent: Tuesday, September 29, 2020 8:05 AM To: devel@edk2.groups.io; Jeff Brasen ; Laszlo Ersek <= lersek@redhat.com> Cc: eric.jin@intel.com; G Edhaya Chandran ; Samer= El-Haj-Mahmoud Subject: RE: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memo= ry protection enabled. External email: Use caution opening links or attachments Jeff, Thanks for the patch. I will send a patch to move the Maintainers.txt one = level up for consistency with other TianoCore repos. Reviewed-By Samer El-Haj-Mahmoud > From: devel@edk2.groups.io > On Behalf Of Jeff Brasen via groups.io Sent: Wednesday, September 23, 2020 11:56 AM To: Laszlo Ersek >; devel@edk2= .groups.io Cc: eric.jin@intel.com; G Edhaya Chandran > Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memo= ry protection enabled. Didn't see it at first as it was not at the top of edk2-test but under uef= i-sct. CC'd maintainers Thanks, Jeff ________________________________ From: Laszlo Ersek > Sent: Wednesday, September 23, 2020 2:59 AM To: devel@edk2.groups.io >; Jeff Brasen > Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memo= ry protection enabled. External email: Use caution opening links or attachments On 09/23/20 00:13, Jeff Brasen wrote: > Any comments on this change? I suggest CC'ing the maintainers responsible for reviewing this change. (I don't know who they are, unfortunately -- is there a Maintainers.txt file in the uefi-sct tree?) Thanks Laszlo > > > Thanks, > > Jeff > > ________________________________ > From: Jeff Brasen > > Sent: Friday, September 11, 2020 11:23 AM > To: devel@edk2.groups.io > > Cc: Jeff Brasen > > Subject: [PATCH] uefi-sct/SctPkg: Correct issue with memory protection e= nabled. > > On systems with memory protection enabled the modification of local > function initialization data results in permission issue. Make a copy of > data prior to modification. > > Signed-off-by: Jeff Brasen > > --- > .../UnicodeCollationBBTestFunction.c | 38 ++++++++++--------- > .../UnicodeCollation2BBTestFunction.c | 38 ++++++++++--------- > 2 files changed, 42 insertions(+), 34 deletions(-) > > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation= /BlackBoxTest/UnicodeCollationBBTestFunction.c b/uefi-sct/SctPkg/TestCase/U= EFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFuncti= on.c > index 6fa11e6c..e0b4c1d9 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackB= oxTest/UnicodeCollationBBTestFunction.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackB= oxTest/UnicodeCollationBBTestFunction.c > @@ -25,7 +25,7 @@ Abstract: > --*/ > > > > > > -#include "SctLib.h" > +#include "SctLib.h" > > #include "UnicodeCollationBBTestMain.h" > > > > > > @@ -337,6 +337,7 @@ BBTestStrLwrFunctionAutoTest ( > }; > > > > CHAR16 TestDataSav[MAX_SIZE_OF_STRING += 1]; > > + CHAR16 TestDataRw[MAX_SIZE_OF_STRING + = 1]; > > > > > > > > @@ -368,14 +369,15 @@ BBTestStrLwrFunctionAutoTest ( > // > > // Backup current test data > > // > > + CopyUnicodeString (TestDataRw, TestData[Index]); > > CopyUnicodeString (TestDataSav, TestData[Index]); > > > > // > > // For each test data, test the StrLwr functionality. > > // > > - UnicodeCollation->StrLwr (UnicodeCollation, TestData[Index]); > > + UnicodeCollation->StrLwr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrLwr (TestDataSav, TestData[Index])) { > > + if (CheckStrLwr (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -390,15 +392,15 @@ BBTestStrLwrFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > > > > > - CopyUnicodeString (TestDataSav, TestData[Index]); > > - UnicodeCollation->StrUpr (UnicodeCollation, TestData[Index]); > > - UnicodeCollation->StrLwr (UnicodeCollation, TestData[Index]); > > + CopyUnicodeString (TestDataSav, TestDataRw); > > + UnicodeCollation->StrUpr (UnicodeCollation, TestDataRw); > > + UnicodeCollation->StrLwr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrEql (TestDataSav, TestData[Index])) { > > + if (CheckStrEql (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -413,7 +415,7 @@ BBTestStrLwrFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > }; > > > > @@ -458,6 +460,7 @@ BBTestStrUprFunctionAutoTest ( > }; > > > > CHAR16 TestDataSav[MAX_SIZE_OF_STRING += 1]; > > + CHAR16 TestDataRw[MAX_SIZE_OF_STRING + = 1]; > > > > > > > > @@ -490,13 +493,14 @@ BBTestStrUprFunctionAutoTest ( > // Backup current test data > > // > > CopyUnicodeString (TestDataSav, TestData[Index]); > > + CopyUnicodeString (TestDataRw, TestData[Index]); > > > > // > > // For each test data, test the StrUpr functionality. > > // > > - UnicodeCollation->StrUpr (UnicodeCollation, TestData[Index]); > > + UnicodeCollation->StrUpr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrUpr (TestDataSav, TestData[Index])) { > > + if (CheckStrUpr (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -511,14 +515,14 @@ BBTestStrUprFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > > > - CopyUnicodeString (TestDataSav, TestData[Index]); > > - UnicodeCollation->StrLwr (UnicodeCollation, TestData[Index]); > > - UnicodeCollation->StrUpr (UnicodeCollation, TestData[Index]); > > + CopyUnicodeString (TestDataSav, TestDataRw); > > + UnicodeCollation->StrLwr (UnicodeCollation, TestDataRw); > > + UnicodeCollation->StrUpr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrEql (TestDataSav, TestData[Index])) { > > + if (CheckStrEql (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -533,7 +537,7 @@ BBTestStrUprFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > }; > > > > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation= 2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase= /UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFu= nction.c > index 653b263a..19ff6764 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/Black= BoxTest/UnicodeCollation2BBTestFunction.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/Black= BoxTest/UnicodeCollation2BBTestFunction.c > @@ -25,7 +25,7 @@ Abstract: > --*/ > > > > > > -#include "SctLib.h" > +#include "SctLib.h" > > #include "UnicodeCollation2BBTestMain.h" > > > > STATIC CONST STRICOLL_TEST_DATA_FIELD mStriCollTestData[] = =3D{ > > @@ -335,6 +335,7 @@ BBTestStrLwrFunctionAutoTest ( > }; > > > > CHAR16 TestDataSav[MAX_SIZE_OF_STRING += 1]; > > + CHAR16 TestDataRw[MAX_SIZE_OF_STRING + = 1]; > > > > > > > > @@ -367,13 +368,14 @@ BBTestStrLwrFunctionAutoTest ( > // Backup current test data > > // > > CopyUnicodeString (TestDataSav, TestData[Index]); > > + CopyUnicodeString (TestDataRw, TestData[Index]); > > > > // > > // For each test data, test the StrLwr functionality. > > // > > - UnicodeCollation->StrLwr (UnicodeCollation, TestData[Index]); > > + UnicodeCollation->StrLwr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrLwr (TestDataSav, TestData[Index])) { > > + if (CheckStrLwr (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -388,15 +390,15 @@ BBTestStrLwrFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > > > > > - CopyUnicodeString (TestDataSav, TestData[Index]); > > - UnicodeCollation->StrUpr (UnicodeCollation, TestData[Index]); > > - UnicodeCollation->StrLwr (UnicodeCollation, TestData[Index]); > > + CopyUnicodeString (TestDataSav, TestDataRw); > > + UnicodeCollation->StrUpr (UnicodeCollation, TestDataRw); > > + UnicodeCollation->StrLwr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrEql (TestDataSav, TestData[Index])) { > > + if (CheckStrEql (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -411,7 +413,7 @@ BBTestStrLwrFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > }; > > > > @@ -456,6 +458,7 @@ BBTestStrUprFunctionAutoTest ( > }; > > > > CHAR16 TestDataSav[MAX_SIZE_OF_STRING += 1]; > > + CHAR16 TestDataRw[MAX_SIZE_OF_STRING + = 1]; > > > > > > > > @@ -488,13 +491,14 @@ BBTestStrUprFunctionAutoTest ( > // Backup current test data > > // > > CopyUnicodeString (TestDataSav, TestData[Index]); > > + CopyUnicodeString (TestDataRw, TestData[Index]); > > > > // > > // For each test data, test the StrUpr functionality. > > // > > - UnicodeCollation->StrUpr (UnicodeCollation, TestData[Index]); > > + UnicodeCollation->StrUpr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrUpr (TestDataSav, TestData[Index])) { > > + if (CheckStrUpr (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -509,14 +513,14 @@ BBTestStrUprFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > > > - CopyUnicodeString (TestDataSav, TestData[Index]); > > - UnicodeCollation->StrLwr (UnicodeCollation, TestData[Index]); > > - UnicodeCollation->StrUpr (UnicodeCollation, TestData[Index]); > > + CopyUnicodeString (TestDataSav, TestDataRw); > > + UnicodeCollation->StrLwr (UnicodeCollation, TestDataRw); > > + UnicodeCollation->StrUpr (UnicodeCollation, TestDataRw); > > > > - if (CheckStrEql (TestDataSav, TestData[Index])) { > > + if (CheckStrEql (TestDataSav, TestDataRw)) { > > AssertionType =3D EFI_TEST_ASSERTION_PASSED; > > } else { > > AssertionType =3D EFI_TEST_ASSERTION_FAILED; > > @@ -531,7 +535,7 @@ BBTestStrUprFunctionAutoTest ( > __FILE__, > > (UINTN)__LINE__, > > TestDataSav, > > - TestData[Index] > > + TestDataRw > > ); > > }; > > > > -- > 2.25.1 > > > > > > > IMPORTANT NOTICE: The contents of this email and any attachments are confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y other person, use it for any purpose, or store or copy the information in= any medium. Thank you. --_000_DM6PR12MB3340D676F270D5ED35F3349DCB0C0DM6PR12MB3340namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Are we looking for any other reviews on this?<= /o:p>

 

Thanks,

Jeff

 

From: Samer El-Haj-Mahmoud <Samer.El-Haj-= Mahmoud@arm.com>
Sent: Tuesday, September 29, 2020 8:05 AM
To: devel@edk2.groups.io; Jeff Brasen <jbrasen@nvidia.com>; L= aszlo Ersek <lersek@redhat.com>
Cc: eric.jin@intel.com; G Edhaya Chandran <Edhaya.Chandran@arm.c= om>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Subject: RE: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue wi= th memory protection enabled.

 

External email: Use caution opening = links or attachments

 

Jeff,

 

Thanks for the patch. I will send a patch to move t= he Maintainers.txt one level up for consistency with other TianoCore repos.=

 

Reviewed-By Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>=

 

From: devel@edk2.groups.io <deve= l@edk2.groups.io> On Behalf Of Jeff Brasen via groups.io
Sent: Wednesday, September 23, 2020 11:56 AM
To: Laszlo Ersek <lersek@re= dhat.com>; devel@edk2.groups.io
Cc: eric.jin@intel.com; G= Edhaya Chandran <Edhaya.Chan= dran@arm.com>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue wi= th memory protection enabled.

 

Didn't= see it at first as it was not at the top of edk2-test but under uefi-sct. = CC'd maintainers

&= nbsp;

Thanks,

Jeff


External email: Use = caution opening links or attachments


On 09/23/20 00:13, Jeff Brasen wrote:
> Any comments on this change?

I suggest CC'ing the maintainers responsible for reviewing this change. (I don't know who they are, unfortunately -- is there a Maintainers.txt file in the uefi-sct tree?)

Thanks
Laszlo

>
>
> Thanks,
>
> Jeff
>
> ________________________________
> From: Jeff Brasen <
jbrasen@n= vidia.com>
> Sent: Friday, September 11, 2020 11:23 AM
> To: devel@edk2.groups.io = <devel@edk2.groups.io> > Cc: Jeff Brasen <jbrasen@nvi= dia.com>
> Subject: [PATCH] uefi-sct/SctPkg: Correct issue with memory protectio= n enabled.
>
> On systems with memory protection enabled the modification of local > function initialization data results in permission issue. Make a copy= of
> data prior to modification.
>
> Signed-off-by: Jeff Brasen <= jbrasen@nvidia.com>
> ---
>  .../UnicodeCollationBBTestFunction.c    &nb= sp;     | 38 ++++++++++---------
>  .../UnicodeCollation2BBTestFunction.c    &n= bsp;    | 38 ++++++++++---------
>  2 files changed, 42 insertions(+), 34 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollat= ion/BlackBoxTest/UnicodeCollationBBTestFunction.c b/uefi-sct/SctPkg/TestCas= e/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFun= ction.c
> index 6fa11e6c..e0b4c1d9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/Bla= ckBoxTest/UnicodeCollationBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/Bla= ckBoxTest/UnicodeCollationBBTestFunction.c
> @@ -25,7 +25,7 @@ Abstract:
>  --*/
>
>
>
>
>
> -#include "SctLib.h"
> +#include "SctLib.h"
>
>  #include "UnicodeCollationBBTestMain.h"
>
>
>
>
>
> @@ -337,6 +337,7 @@ BBTestStrLwrFunctionAutoTest (
>           &nbs= p;            &= nbsp;           &nbs= p;     };
>
>
>
>    CHAR16       &nb= sp;            =            TestDataSav[MA= X_SIZE_OF_STRING + 1];
>
> +  CHAR16         &= nbsp;           &nbs= p;         TestDataRw[MAX_SIZE_OF_S= TRING + 1];
>
>
>
>
>
>
>
> @@ -368,14 +369,15 @@ BBTestStrLwrFunctionAutoTest (
>      //
>
>      // Backup current test data
>
>      //
>
> +    CopyUnicodeString (TestDataRw, TestData[Index]);<= br> >
>      CopyUnicodeString (TestDataSav, TestDat= a[Index]);
>
>
>
>      //
>
>      // For each test data, test the StrLwr = functionality.
>
>      //
>
> -    UnicodeCollation->StrLwr (UnicodeCollation, Te= stData[Index]);
>
> +    UnicodeCollation->StrLwr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrLwr (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrLwr (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -390,15 +392,15 @@ BBTestStrLwrFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>
>
>
>
> -    CopyUnicodeString (TestDataSav, TestData[Index]);=
>
> -    UnicodeCollation->StrUpr (UnicodeCollation, Te= stData[Index]);
>
> -    UnicodeCollation->StrLwr (UnicodeCollation, Te= stData[Index]);
>
> +    CopyUnicodeString (TestDataSav, TestDataRw);
>
> +    UnicodeCollation->StrUpr (UnicodeCollation, Te= stDataRw);
>
> +    UnicodeCollation->StrLwr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrEql (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrEql (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -413,7 +415,7 @@ BBTestStrLwrFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>    };
>
>
>
> @@ -458,6 +460,7 @@ BBTestStrUprFunctionAutoTest (
>           &nbs= p;            &= nbsp;           &nbs= p;     };
>
>
>
>    CHAR16       &nb= sp;            =            TestDataSav[MA= X_SIZE_OF_STRING + 1];
>
> +  CHAR16         &= nbsp;           &nbs= p;         TestDataRw[MAX_SIZE_OF_S= TRING + 1];
>
>
>
>
>
>
>
> @@ -490,13 +493,14 @@ BBTestStrUprFunctionAutoTest (
>      // Backup current test data
>
>      //
>
>      CopyUnicodeString (TestDataSav, TestDat= a[Index]);
>
> +    CopyUnicodeString (TestDataRw, TestData[Index]);<= br> >
>
>
>      //
>
>      // For each test data, test the StrUpr = functionality.
>
>      //
>
> -    UnicodeCollation->StrUpr (UnicodeCollation, Te= stData[Index]);
>
> +    UnicodeCollation->StrUpr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrUpr (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrUpr (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -511,14 +515,14 @@ BBTestStrUprFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>
>
> -    CopyUnicodeString (TestDataSav, TestData[Index]);=
>
> -    UnicodeCollation->StrLwr (UnicodeCollation, Te= stData[Index]);
>
> -    UnicodeCollation->StrUpr (UnicodeCollation, Te= stData[Index]);
>
> +    CopyUnicodeString (TestDataSav, TestDataRw);
>
> +    UnicodeCollation->StrLwr (UnicodeCollation, Te= stDataRw);
>
> +    UnicodeCollation->StrUpr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrEql (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrEql (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -533,7 +537,7 @@ BBTestStrUprFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>    };
>
>
>
> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollat= ion2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestC= ase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTes= tFunction.c
> index 653b263a..19ff6764 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/Bl= ackBoxTest/UnicodeCollation2BBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/Bl= ackBoxTest/UnicodeCollation2BBTestFunction.c
> @@ -25,7 +25,7 @@ Abstract:
>  --*/
>
>
>
>
>
> -#include "SctLib.h"
> +#include "SctLib.h"
>
>  #include "UnicodeCollation2BBTestMain.h"
>
>
>
>  STATIC CONST STRICOLL_TEST_DATA_FIELD    &n= bsp;        mStriCollTestData[] =3D{
>
> @@ -335,6 +335,7 @@ BBTestStrLwrFunctionAutoTest (
>           &nbs= p;            &= nbsp;           &nbs= p;     };
>
>
>
>    CHAR16       &nb= sp;            =            TestDataSav[MA= X_SIZE_OF_STRING + 1];
>
> +  CHAR16         &= nbsp;           &nbs= p;         TestDataRw[MAX_SIZE_OF_S= TRING + 1];
>
>
>
>
>
>
>
> @@ -367,13 +368,14 @@ BBTestStrLwrFunctionAutoTest (
>      // Backup current test data
>
>      //
>
>      CopyUnicodeString (TestDataSav, TestDat= a[Index]);
>
> +    CopyUnicodeString (TestDataRw, TestData[Index]);<= br> >
>
>
>      //
>
>      // For each test data, test the StrLwr = functionality.
>
>      //
>
> -    UnicodeCollation->StrLwr (UnicodeCollation, Te= stData[Index]);
>
> +    UnicodeCollation->StrLwr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrLwr (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrLwr (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -388,15 +390,15 @@ BBTestStrLwrFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>
>
>
>
> -    CopyUnicodeString (TestDataSav, TestData[Index]);=
>
> -    UnicodeCollation->StrUpr (UnicodeCollation, Te= stData[Index]);
>
> -    UnicodeCollation->StrLwr (UnicodeCollation, Te= stData[Index]);
>
> +    CopyUnicodeString (TestDataSav, TestDataRw);
>
> +    UnicodeCollation->StrUpr (UnicodeCollation, Te= stDataRw);
>
> +    UnicodeCollation->StrLwr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrEql (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrEql (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -411,7 +413,7 @@ BBTestStrLwrFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>    };
>
>
>
> @@ -456,6 +458,7 @@ BBTestStrUprFunctionAutoTest (
>           &nbs= p;            &= nbsp;           &nbs= p;     };
>
>
>
>    CHAR16       &nb= sp;            =            TestDataSav[MA= X_SIZE_OF_STRING + 1];
>
> +  CHAR16         &= nbsp;           &nbs= p;         TestDataRw[MAX_SIZE_OF_S= TRING + 1];
>
>
>
>
>
>
>
> @@ -488,13 +491,14 @@ BBTestStrUprFunctionAutoTest (
>      // Backup current test data
>
>      //
>
>      CopyUnicodeString (TestDataSav, TestDat= a[Index]);
>
> +    CopyUnicodeString (TestDataRw, TestData[Index]);<= br> >
>
>
>      //
>
>      // For each test data, test the StrUpr = functionality.
>
>      //
>
> -    UnicodeCollation->StrUpr (UnicodeCollation, Te= stData[Index]);
>
> +    UnicodeCollation->StrUpr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrUpr (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrUpr (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -509,14 +513,14 @@ BBTestStrUprFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>
>
> -    CopyUnicodeString (TestDataSav, TestData[Index]);=
>
> -    UnicodeCollation->StrLwr (UnicodeCollation, Te= stData[Index]);
>
> -    UnicodeCollation->StrUpr (UnicodeCollation, Te= stData[Index]);
>
> +    CopyUnicodeString (TestDataSav, TestDataRw);
>
> +    UnicodeCollation->StrLwr (UnicodeCollation, Te= stDataRw);
>
> +    UnicodeCollation->StrUpr (UnicodeCollation, Te= stDataRw);
>
>
>
> -    if (CheckStrEql (TestDataSav, TestData[Index])) {=
>
> +    if (CheckStrEql (TestDataSav, TestDataRw)) {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType =3D EFI_TEST_= ASSERTION_FAILED;
>
> @@ -531,7 +535,7 @@ BBTestStrUprFunctionAutoTest (
>           &nbs= p;         __FILE__,
>
>           &nbs= p;         (UINTN)__LINE__,
>
>           &nbs= p;         TestDataSav,
>
> -           &n= bsp;       TestData[Index]
>
> +           &n= bsp;       TestDataRw
>
>           &nbs= p;         );
>
>    };
>
>
>
> --
> 2.25.1
>
>
>
>
>
>
>

IMPORTANT NOTICE: The contents of this email and an= y attachments are confidential and may also be privileged. If you are not t= he intended recipient, please notify the sender immediately and do not disc= lose the contents to any other person, use it for any purpose, or store or copy the information in any medium. T= hank you.

--_000_DM6PR12MB3340D676F270D5ED35F3349DCB0C0DM6PR12MB3340namp_--