[edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.

Jeff Brasen posted 1 patch 3 years, 7 months ago
Failed in applying to current master (apply log)
.../UnicodeCollationBBTestFunction.c          | 38 ++++++++++---------
.../UnicodeCollation2BBTestFunction.c         | 38 ++++++++++---------
2 files changed, 42 insertions(+), 34 deletions(-)
[edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by Jeff Brasen 3 years, 7 months ago
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          | 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/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
index 6fa11e6c..e0b4c1d9 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
index 653b263a..19ff6764 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
@@ -25,7 +25,7 @@ Abstract:
 --*/

 

 

-#include "SctLib.h"
+#include "SctLib.h"

 #include "UnicodeCollation2BBTestMain.h"

 

 STATIC CONST STRICOLL_TEST_DATA_FIELD             mStriCollTestData[] ={

@@ -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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = EFI_TEST_ASSERTION_FAILED;

@@ -531,7 +535,7 @@ BBTestStrUprFunctionAutoTest (
                    __FILE__,

                    (UINTN)__LINE__,

                    TestDataSav,

-                   TestData[Index]

+                   TestDataRw

                    );

   };

 

-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#65194): https://edk2.groups.io/g/devel/message/65194
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by Jeff Brasen 3 years, 7 months ago
Any comments on this change?


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 protection 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          | 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/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
index 6fa11e6c..e0b4c1d9 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
index 653b263a..19ff6764 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
@@ -25,7 +25,7 @@ Abstract:
 --*/





-#include "SctLib.h"
+#include "SctLib.h"

 #include "UnicodeCollation2BBTestMain.h"



 STATIC CONST STRICOLL_TEST_DATA_FIELD             mStriCollTestData[] ={

@@ -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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;

     } else {

       AssertionType = EFI_TEST_ASSERTION_FAILED;

@@ -531,7 +535,7 @@ BBTestStrUprFunctionAutoTest (
                    __FILE__,

                    (UINTN)__LINE__,

                    TestDataSav,

-                   TestData[Index]

+                   TestDataRw

                    );

   };



--
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65475): https://edk2.groups.io/g/devel/message/65475
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by Laszlo Ersek 3 years, 7 months ago
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 protection 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          | 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/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> index 6fa11e6c..e0b4c1d9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = 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/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> index 653b263a..19ff6764 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> @@ -25,7 +25,7 @@ Abstract:
>  --*/
> 
> 
> 
> 
> 
> -#include "SctLib.h"
> +#include "SctLib.h"
> 
>  #include "UnicodeCollation2BBTestMain.h"
> 
> 
> 
>  STATIC CONST STRICOLL_TEST_DATA_FIELD             mStriCollTestData[] ={
> 
> @@ -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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
> 
>      } else {
> 
>        AssertionType = EFI_TEST_ASSERTION_FAILED;
> 
> @@ -531,7 +535,7 @@ BBTestStrUprFunctionAutoTest (
>                     __FILE__,
> 
>                     (UINTN)__LINE__,
> 
>                     TestDataSav,
> 
> -                   TestData[Index]
> 
> +                   TestDataRw
> 
>                     );
> 
>    };
> 
> 
> 
> --
> 2.25.1
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65516): https://edk2.groups.io/g/devel/message/65516
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by Jeff Brasen 3 years, 7 months ago
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 <lersek@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 with memory 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 <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 protection 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          | 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/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> index 6fa11e6c..e0b4c1d9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> index 653b263a..19ff6764 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> @@ -25,7 +25,7 @@ Abstract:
>  --*/
>
>
>
>
>
> -#include "SctLib.h"
> +#include "SctLib.h"
>
>  #include "UnicodeCollation2BBTestMain.h"
>
>
>
>  STATIC CONST STRICOLL_TEST_DATA_FIELD             mStriCollTestData[] ={
>
> @@ -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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = EFI_TEST_ASSERTION_FAILED;
>
> @@ -531,7 +535,7 @@ BBTestStrUprFunctionAutoTest (
>                     __FILE__,
>
>                     (UINTN)__LINE__,
>
>                     TestDataSav,
>
> -                   TestData[Index]
>
> +                   TestDataRw
>
>                     );
>
>    };
>
>
>
> --
> 2.25.1
>
>
>
> 
>
>
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65538): https://edk2.groups.io/g/devel/message/65538
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by Samer El-Haj-Mahmoud 3 years, 7 months ago
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 <Samer.El-Haj-Mahmoud@arm.com>

From: devel@edk2.groups.io <devel@edk2.groups.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.com>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with 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


Thanks,

Jeff

________________________________
From: Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>
Sent: Wednesday, September 23, 2020 2:59 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory 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 <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
> Sent: Friday, September 11, 2020 11:23 AM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>
> Cc: Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
> Subject: [PATCH] uefi-sct/SctPkg: Correct issue with memory protection 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<mailto:jbrasen@nvidia.com>>
> ---
>  .../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/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> index 6fa11e6c..e0b4c1d9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> index 653b263a..19ff6764 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> @@ -25,7 +25,7 @@ Abstract:
>  --*/
>
>
>
>
>
> -#include "SctLib.h"
> +#include "SctLib.h"
>
>  #include "UnicodeCollation2BBTestMain.h"
>
>
>
>  STATIC CONST STRICOLL_TEST_DATA_FIELD             mStriCollTestData[] ={
>
> @@ -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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65729): https://edk2.groups.io/g/devel/message/65729
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by Jeff Brasen 3 years, 6 months ago
Are we looking for any other reviews on this?

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>; Laszlo Ersek <lersek@redhat.com>
Cc: eric.jin@intel.com; G Edhaya Chandran <Edhaya.Chandran@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Subject: RE: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory 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 <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of Jeff Brasen via groups.io
Sent: Wednesday, September 23, 2020 11:56 AM
To: Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: eric.jin@intel.com<mailto:eric.jin@intel.com>; G Edhaya Chandran <Edhaya.Chandran@arm.com<mailto:Edhaya.Chandran@arm.com>>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with 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


Thanks,

Jeff

________________________________
From: Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>
Sent: Wednesday, September 23, 2020 2:59 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory 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 <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
> Sent: Friday, September 11, 2020 11:23 AM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>
> Cc: Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
> Subject: [PATCH] uefi-sct/SctPkg: Correct issue with memory protection 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<mailto:jbrasen@nvidia.com>>
> ---
>  .../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/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> index 6fa11e6c..e0b4c1d9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> index 653b263a..19ff6764 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> @@ -25,7 +25,7 @@ Abstract:
>  --*/
>
>
>
>
>
> -#include "SctLib.h"
> +#include "SctLib.h"
>
>  #include "UnicodeCollation2BBTestMain.h"
>
>
>
>  STATIC CONST STRICOLL_TEST_DATA_FIELD             mStriCollTestData[] ={
>
> @@ -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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65901): https://edk2.groups.io/g/devel/message/65901
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by Samer El-Haj-Mahmoud 3 years, 5 months ago
Jeff,

This just needs to be pushed by a maintainer.

Edhaya, Barton,

Can you please push the commit?

Thanks,
--Samer

From: Jeff Brasen <jbrasen@nvidia.com>
Sent: Monday, October 5, 2020 5:26 PM
To: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; devel@edk2.groups.io; Laszlo Ersek <lersek@redhat.com>
Cc: eric.jin@intel.com; G Edhaya Chandran <Edhaya.Chandran@arm.com>
Subject: RE: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.

Are we looking for any other reviews on this?

Thanks,
Jeff

From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>
Sent: Tuesday, September 29, 2020 8:05 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>; Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>
Cc: eric.jin@intel.com<mailto:eric.jin@intel.com>; G Edhaya Chandran <Edhaya.Chandran@arm.com<mailto:Edhaya.Chandran@arm.com>>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>
Subject: RE: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory 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 <Samer.El-Haj-Mahmoud@arm.com<mailto:Samer.El-Haj-Mahmoud@arm.com>>

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of Jeff Brasen via groups.io
Sent: Wednesday, September 23, 2020 11:56 AM
To: Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: eric.jin@intel.com<mailto:eric.jin@intel.com>; G Edhaya Chandran <Edhaya.Chandran@arm.com<mailto:Edhaya.Chandran@arm.com>>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with 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


Thanks,

Jeff

________________________________
From: Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>
Sent: Wednesday, September 23, 2020 2:59 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
Subject: Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory 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 <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
> Sent: Friday, September 11, 2020 11:23 AM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>
> Cc: Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>
> Subject: [PATCH] uefi-sct/SctPkg: Correct issue with memory protection 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<mailto:jbrasen@nvidia.com>>
> ---
>  .../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/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> index 6fa11e6c..e0b4c1d9 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/UnicodeCollationBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation/BlackBoxTest/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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> index 653b263a..19ff6764 100644
> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UnicodeCollation2/BlackBoxTest/UnicodeCollation2BBTestFunction.c
> @@ -25,7 +25,7 @@ Abstract:
>  --*/
>
>
>
>
>
> -#include "SctLib.h"
> +#include "SctLib.h"
>
>  #include "UnicodeCollation2BBTestMain.h"
>
>
>
>  STATIC CONST STRICOLL_TEST_DATA_FIELD             mStriCollTestData[] ={
>
> @@ -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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 = EFI_TEST_ASSERTION_PASSED;
>
>      } else {
>
>        AssertionType = 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 confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#67308): https://edk2.groups.io/g/devel/message/67308
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] uefi-sct/SctPkg: Correct issue with memory protection enabled.
Posted by G Edhaya Chandran 3 years, 5 months ago
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>

Upstreamed by Commit-id: https://github.com/tianocore/edk2-test/commit/f96b1f9b8d569a9527c7204f86b4155e1fd8bc2b


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#67902): https://edk2.groups.io/g/devel/message/67902
Mute This Topic: https://groups.io/mt/76784632/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-