From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by mx.groups.io with SMTP id smtpd.web10.17254.1600876587977186820 for ; Wed, 23 Sep 2020 08:56:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=IRpcEwAI; spf=pass (domain: nvidia.com, ip: 216.228.121.64, mailfrom: jbrasen@nvidia.com) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 23 Sep 2020 08:55:40 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 23 Sep 2020 15:56:19 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 23 Sep 2020 15:56:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=njvf582fgjZRypN3qiVjtg9JbMiNP1p1XkaMCQ2Cc0em/9AcMfW8KwkEj1quS0B3vDI/yB+S+TwGDWnAYeap0DQ7qrEzUnjEwiubLQJqtRrFNTmKfnZ4yPrtjWFul4Gr3myzBstdPz9PFVIx9/2UjL99AF9Rylz/bOAymGOKDL98PqAHTbL0NQ01SUV3gDSjUMrxldG0Xhzsv9BWgO+jYhx8CgkGf3Cuj+sJE2xao0qfLuHYYHIZrXxkS1jzRAd0yBOMj71Z7MG3lxI43XZZAoWgdZT2v8eMLIQQpRb5vgQiEBEWfDmxfcfyhPG+sE5Klbdm4x201I8DXE6giBMwlw== 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=2JPj5y/DZxHjEUJfuadAtwURl9stGMgdJZU2OHZ/m00=; b=WzfR9XvtH8Z7Jt5m2YG/s5XVgz9PpokEhQNFGRfZibrTzJ2u6BkTv9uLgTxFnhRFcXLrcTSiflOwnXemM/JBq/nuje4cjKgmB5LEMD8y/9X1m7clf3yveFOc+r+tUCfQuIYdMoCAH7PoYUjKyk40Vy24BgjtJDmxaNrIyqJizKrCRywfq6KOVXSuZsTkeYD3OwNGkU9kgN/WfKsDPRpZPVjlgnTtgnd/opjJSWsHs4NXz6wni4Jm3ibiUtkIujaectD/hpOeqKcYEDwGgvwCwpkm1iJ2w+DZ/PsND+GwSzAfw0Aio00JVfEYqsYyKx66aO2SGWRRemDmIpClPmol1g== 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 BYAPR12MB3335.namprd12.prod.outlook.com (2603:10b6:a03:dd::11) by BY5PR12MB3891.namprd12.prod.outlook.com (2603:10b6:a03:1a3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11; Wed, 23 Sep 2020 15:56:16 +0000 Received: from BYAPR12MB3335.namprd12.prod.outlook.com ([fe80::9ca8:39a9:65c7:c41b]) by BYAPR12MB3335.namprd12.prod.outlook.com ([fe80::9ca8:39a9:65c7:c41b%6]) with mapi id 15.20.3391.027; Wed, 23 Sep 2020 15:56:16 +0000 From: "Jeff Brasen" To: Laszlo Ersek , "devel@edk2.groups.io" CC: "eric.jin@intel.com" , "Edhaya.Chandran@arm.com" 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/gAC0h4CAAHQoEQ== Date: Wed, 23 Sep 2020 15:56:15 +0000 Message-ID: References: <4d637a44c99f0aaa8d78b2def96114d7dc3b1bb6.1599844750.git.jbrasen@nvidia.com> ,<5fedff50-5a4b-e57a-055f-794d071eac86@redhat.com> In-Reply-To: <5fedff50-5a4b-e57a-055f-794d071eac86@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [2601:281:8100:1241:4d79:4253:57e4:4cb5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 011ede7b-9351-4c2b-3c07-08d85fd9342b x-ms-traffictypediagnostic: BY5PR12MB3891: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DosjblsCCbX0kM6MSZ9PijmBU0JUcVemJq0IX9FVAcoeOAswLtX9jNNUysLzAw0oJLhoZkzHeUB2UioNvnqxKihkLa2MGsyrTZU/8ImfseVqEQJNKitmXPBZd36n6FQQyhchT1IqR4ELTD7KtRwEkKEAkpp8hRXT/sDKj2wp/lAAtQDD+llaRLRqhWfDT55sc9KSkFa9e8trJG8LvZVIxutkaiTLsspeWUy2hdGk1qwAdF/CGTU318wcMWZw7i3bya+DvYDftWmLPJI24rZqlYJ59UpafKOLuLZ1A6swDLZvkteLtFqNe8S8ldHK1Ol99ye3/JZ5NpjgNwv6l5C3tq6LhrocoWxFfO1ut8oHeFwjFmsiqbHsicp9SvWmWhOX/7fVbgRxoxsgLe8S6Ju8Rw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3335.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(136003)(396003)(39860400002)(346002)(6506007)(64756008)(66556008)(66446008)(66476007)(110136005)(8936002)(2906002)(8676002)(966005)(30864003)(54906003)(5660300002)(33656002)(86362001)(52536014)(19627405001)(83380400001)(91956017)(76116006)(66946007)(166002)(71200400001)(53546011)(316002)(186003)(55016002)(478600001)(9686003)(4326008)(7696005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: 5f3Yw80es3pcnCgiIZG63mvRbPMMsy45aDomMeyg4vMnc1svd5XT1dL2TW+7E166gcCFKfu7JxumWSek8UpRorh6xpEWeItYAUKdHrwzmTLvhCynZdX3rmCm2DiH0E+ZkRIkWAC5ll1rXi9YltB7NLQ5/cqIPVC4LuHMpOjO/nZCKfuBGDXHfEz9K6su1xhgJEzCFls4MlzTG4reE4vO6q7krPbiTjh8WrGXDfAnrRGg3EqMTi/z7XuoHY+xjX4CqAZy8b76Jk9hlnUXro8CHW+TWzKgJAmtMqQk5KDJ/xA5E84gp/OpD7jTvi/zZiYgV9+kt0piMKS0TCOWDrsQraGj1l4LStpwHKTyTkY9vnRd8gxmfdGayWa8ggU1sW+1Jlfg9iH8ilBUYfoxXek8xQXfhNB1crCRmc/EErhijADKtomec7AneubyWxHzixuqr/bAgFMYNm9nZRnDGJuEh2LZsJFY5hGIf6jq8ZoyKe30iAKINPZostZzDls1KJHcTm+7XHXXFitAFDfXBpPah8stPE5aHdDKxhrdqPuTI98NimK/XtVX+utHlhgssJ1qHtD39eWvLXjWfmd51PRXh9V4v/AAelGXphL2HvBZIaSLX7Y5YVqZsIxjBma2J1n3jNaiT+RN02EXv5rFuibiD60vQLt6G8srHZlEdqv7YLcxDvLT34mPCqlGxdeNfAjbVbN6IXMvlOQY3oP76XAb8w== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3335.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 011ede7b-9351-4c2b-3c07-08d85fd9342b X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Sep 2020 15:56:15.3769 (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: EmP7f0dFsBllAnzyJbiAVUS5NZHzPEFix9axj4masTpP2ibUCQuwPPyibMA0N3yXOZH+603QyjCWpdEbsqd3UA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3891 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=1600876540; bh=2JPj5y/DZxHjEUJfuadAtwURl9stGMgdJZU2OHZ/m00=; 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: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=IRpcEwAIg6hQiP+PweNDusQEGPMIQtVLjNWjlgpn+fYRcduk0EONM01RqlgOBFibL 95FUtopKhIfFeRgLOeKJ8U9FNccwV++caozN3ejr6B17bO3yc1BArKALImC7Jybrav p4B3of0KHMNh6DeZId4mZZe9fcIL2ENYiDYYe5jUVQzqf+6JPTB+hTkdI4JoWvEsMv 1csGezATxtC3SEvQ/sIUHvCPJagGheg/76d2T7vxDKqu2cjEOXA+1IwZp+63O9LbYJ N0f1N/qVCYdHbF63tYng+HenpSvnRKHnUwQr23BlIlcuMGBDM4QK8CQaqfAEXuB82m /gfBnIlLm1qBw== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BYAPR12MB33356359F90FFAC45024641DCB380BYAPR12MB3335namp_" --_000_BYAPR12MB33356359F90FFAC45024641DCB380BYAPR12MB3335namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Didn't see it at first as it was not at the top of edk2-test but under uefi= -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 > > > >=20 > > > --_000_BYAPR12MB33356359F90FFAC45024641DCB380BYAPR12MB3335namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
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 <ler= sek@redhat.com>
Sent: Wednesday, September 23, 2020 2:59 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Jeff Brasen = <jbrasen@nvidia.com>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue wi= th memory protection enabled.
 
External email: Use caution opening links or atta= chments


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@nvidia.com>
> Sent: Friday, September 11, 2020 11:23 AM
> To: devel@edk2.groups.io <devel@edk2.groups.io>
> Cc: Jeff Brasen <jbrasen@nvidia.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
>
>
>
>
>
>
>

--_000_BYAPR12MB33356359F90FFAC45024641DCB380BYAPR12MB3335namp_--