From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.54]) by mx.groups.io with SMTP id smtpd.web10.456.1601388332645358904 for ; Tue, 29 Sep 2020 07:05:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=40N4wpNS; spf=pass (domain: arm.com, ip: 40.107.14.54, mailfrom: samer.el-haj-mahmoud@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=iXusPXN2TYMlyj5oMBFmQjXLiivbAGRORTOHJhKTYZY=; b=40N4wpNSVhhr9YXnkKcEl9bNfQR+Y+Xo0uIsty2MPeBdbM3LJQYtsdKMZQxf1ESjIaeXZQijGyzGydGTKpPP0MCH16IVcFCpYPrniIvd4L5GakIaPXDoyMqJsBvGI8T8KJsF3oAkJZ4H3dmfFX8uN30qnXYZEdOu3LyaCzzw9H8= Received: from DB6PR07CA0017.eurprd07.prod.outlook.com (2603:10a6:6:2d::27) by VI1PR08MB3469.eurprd08.prod.outlook.com (2603:10a6:803:8a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Tue, 29 Sep 2020 14:05:28 +0000 Received: from DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2d:cafe::8f) by DB6PR07CA0017.outlook.office365.com (2603:10a6:6:2d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.18 via Frontend Transport; Tue, 29 Sep 2020 14:05:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT062.mail.protection.outlook.com (10.152.20.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Tue, 29 Sep 2020 14:05:28 +0000 Received: ("Tessian outbound 34b830c8a0ef:v64"); Tue, 29 Sep 2020 14:05:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a186b67bf72db1cf X-CR-MTA-TID: 64aa7808 Received: from c29b9d65777a.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F5FB1CA0-1D0F-452A-963D-C593ACC6564F.1; Tue, 29 Sep 2020 14:05:23 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c29b9d65777a.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 29 Sep 2020 14:05:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d7Cm8l/u6l2ok1dEU++HapdggfWyX29Dl9tnYhWxP7LxI1A5qCkzBAq7bsNly3Z3SkRxPfU8r+7TVt/kC7Ubl/dvopJw4l6Dc7ikT8+3Aco0yschj7zaUkQ6fXpsp+i8T0EKXiRc57+i6zZIOTsO3hAtFda1ZIywrS5RXyBAzDN7vMIn15Hq0Ng43TvmWIcJL23/CShkm6SU4dacrMoGL/L6rzM1hhMTJCDpXaaCmgG6k6F3aWdaxaSkSrsTRn4wdIWrcH7SrYmS4CUn/YLB2s3F7Xt70zHPwIHdXTuKrk9+cri+ja2WFGrehm/ZCGN0VgA20jNYPVi4RXDaayyWoA== 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=iXusPXN2TYMlyj5oMBFmQjXLiivbAGRORTOHJhKTYZY=; b=eWRSN9UVFckE6DjRYsVSvqMJe3mHzKlqrN1I1kZg48AY4m5aPQ0X2Bj9RFX4c6KDFBDhmIUUXwnqGp4gRS+8ppWGrq9lCLEpSakcGtp71Y5PWuYzHoIK0Y27jBv2XBVGGjf419hk9yiX9mw1AoG3xQA54V6FhfgVHgW4fd0aL7PZ0BkaRE5azytD/uINRDK4VSvvIE6oyVrEovsL9Pypzw+KoFFi5hMYsLDooeG0KlsdHQnsoFO2IO9L0E78BxQlC0LA3DaQ0v6V6UAgSljUNK1nJ9Op5MiEVjpYhYVEet93WMYWV2Lz+4XAKfVy7/QEENHGLnjoDb0qUjyoQjvrrg== 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=iXusPXN2TYMlyj5oMBFmQjXLiivbAGRORTOHJhKTYZY=; b=40N4wpNSVhhr9YXnkKcEl9bNfQR+Y+Xo0uIsty2MPeBdbM3LJQYtsdKMZQxf1ESjIaeXZQijGyzGydGTKpPP0MCH16IVcFCpYPrniIvd4L5GakIaPXDoyMqJsBvGI8T8KJsF3oAkJZ4H3dmfFX8uN30qnXYZEdOu3LyaCzzw9H8= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DB7PR08MB3692.eurprd08.prod.outlook.com (2603:10a6:10:30::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.25; Tue, 29 Sep 2020 14:05:20 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::41d6:2494:e616:78a6]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::41d6:2494:e616:78a6%7]) with mapi id 15.20.3412.029; Tue, 29 Sep 2020 14:05:20 +0000 From: "Samer El-Haj-Mahmoud" To: "devel@edk2.groups.io" , "Jeff Brasen (jbrasen@nvidia.com)" , Laszlo Ersek CC: "eric.jin@intel.com" , G Edhaya Chandran , Samer El-Haj-Mahmoud 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: AQHWiGB/d6ejkHaAKUGtGZC5sRhu+al1Sm+AgAC0eYCAAHR5gIAJTsmw Date: Tue, 29 Sep 2020 14:05:20 +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: Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e8295f6d-3968-42e2-7cc5-08d86480b88f x-ms-traffictypediagnostic: DB7PR08MB3692:|VI1PR08MB3469: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:5797;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HYeRhHUkHdNT88UdEkEUbe0uKpoQpo9Ay9QFFUADWCEFC5VFKYQs8yrEDgnldbQQscyrPez6jkQbroz+GPkm+EHpxPMA/jztlqQ8wXgQtG+84AP2b/LaRW51MXUr2cYu7GwdKqL8ABiIjLU1/ORjlbitDpWywemjZuLWuJri5BMDfewLa0Jdp9KFvPmjgWPBazgMGdORVvS7yGbugbQm/Hn5A1Ch8ldAsYvbv9MotwNvWOWkVs+0HTXwnKj2uUyEs9j2HOf24Ng2nDoJY79Pl3kIU850Z4ppchJ9kQI0kvoPX2Mi9x9r/smnEm/1n+Hxj31YVGpdHYBUnu12WnuJ//RrvJ8FvsUWMcAHL1HARhUpg85y/3LAu6Z4ALqQw3zoSREpBWOAaO+49NRgJ2lYGqzNLORAXAeCGclIgKSU6PG4jpVcAUFfRlpsIh+f3PWUfunovav0MRdjKZIHV6ImGw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(39850400004)(376002)(346002)(366004)(9686003)(110136005)(55016002)(52536014)(166002)(76116006)(83380400001)(66946007)(4326008)(71200400001)(76236003)(8676002)(316002)(8936002)(66556008)(66476007)(7696005)(54906003)(30864003)(5660300002)(64756008)(6506007)(66446008)(2906002)(186003)(53546011)(478600001)(33656002)(26005)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: vLddw+7DnDOr7VNcHDe3AFCMMNbrklYey9npFHsDexIAi8Ge4C7NboP+IuXEWSuJBn6MeDGMDnyY43dNTTSa5ICdB9+p8qb2yMItzN9X99iGvkg82ZHw2x5iGqBySJgMxR7G0XwzLD6DD5Zh4dzsW/iQ4Qfgeqm/76MQgkNPuitbm6Dsjw8qrSpfM6wO1V06CFqH/ssRfUzrFVkkFNzZjbDuXkdxuiu3UGoId3poSstYSZRqbSoDQCwYHBF/nApc9ZDo8HTN14kr45pqhQEph1Hhf/epSKROrXz8sfMm9OfNYwKiG4OXq9dZoHvBlHcIIZkmrLJJkEq1HPUz27WWBZetgRIMLor7sKJ7RMnSOAWXMBHH5n2NLHBbFyipKa/R85bQNQbz1Vbfw/ElcDmsDH1ZnMqyjBBy9PX7T2pI693Ta5wC1vPkKZ48rKA1okzBE94voaUVjOKvXt7Yy9ffoZQPeiqm+MHajx8ySUf2dFOH6QxgdxU6g1iIZcMzG2Rdk/3M0vw9yI0DqAE/5GmUUGSABP3z6Mt1UeBwMISPM6cN6Yze+csRuyPjrzma0KSzkCWbKmclcYrIZ/Ao7FtM4pJkJZSiJieRy+QbdcLwyQKKwVeni5EXxI7FbwnrXr8C259xR6IjnzMRjpO3QFPi+g== MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3692 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 1e74944c-599e-4dc6-8fc2-08d86480b394 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wQ6I34AxG3YXY8ZR01oYDpA1LUYkjwZm43hPpc3QKYejucoc7GDvnCt27THQ7J3kzw5Fyx0bBP6i6cTX9nX0mfAUUlms4c1MZMqx284twvKkF21ovLC0M/Y9zfP8WO3QmGzzy9MqDmsRopYWH4Ca3GJlwiAL1uhrrQTD0k0wlflA+Rx8jpLIPT3FAxC+GxvLO7138E+FsrZ6Wma96LpZ5g1JnC03zIEGcT3NUsx9aLteOj3kE5W2MAIfxKNKv4fJW6yoZTakdTEjAlHfpDLMlIQGa9uRbDiJx/jwa2HQYSrXBG/n72ic4l6YjeAC+4UL9pJHaVLqvpC+fRwU6qyy7yamt8r0/aQtmorgjZNlpnCPQtVwGYtGZQwSVh94MhralH/R4mPF7KpyxyXWMfD8cZvZUwq6cffE1PJiBJOaMiwk3HUXORldRdK5qFCIzKga8hBE+9EI0cVDMag0vh4EfbaVmn4r7XLtBomlM30vXhGg9CmAIhc1Ln5BGkh3YEYjURlbnPrVy911whrOSOyXlA== 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:(4636009)(39850400004)(346002)(376002)(396003)(136003)(46966005)(4326008)(6506007)(26005)(53546011)(47076004)(55016002)(52536014)(8676002)(33656002)(8936002)(19627235002)(30864003)(5660300002)(186003)(86362001)(54906003)(70206006)(7696005)(336012)(81166007)(70586007)(76236003)(83380400001)(356005)(2906002)(166002)(110136005)(9686003)(316002)(478600001)(82310400003)(82740400003)(579004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2020 14:05:28.7848 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8295f6d-3968-42e2-7cc5-08d86480b88f 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: DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3469 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DB7PR08MB3260210E636AD1F1AED7836B90320DB7PR08MB3260eurp_" --_000_DB7PR08MB3260210E636AD1F1AED7836B90320DB7PR08MB3260eurp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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_DB7PR08MB3260210E636AD1F1AED7836B90320DB7PR08MB3260eurp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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-M= ahmoud@arm.com>

 

From: devel@edk2.groups.io <devel@edk2.gr= oups.io> On Behalf Of Jeff Brasen via groups.io
Sent: Wednesday, September 23, 2020 11:56 AM
To: Laszlo Ersek <lersek@redhat.com>; devel@edk2.groups.io Cc: eric.jin@intel.com; G Edhaya Chandran <Edhaya.Chandran@arm.c= om>
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 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_DB7PR08MB3260210E636AD1F1AED7836B90320DB7PR08MB3260eurp_--