[edk2-devel] [Patch 02/16] Vlv2TbltDevicePkg/AcpiPlatform: Change Size type to UINTN

Michael D Kinney posted 16 patches 6 years, 9 months ago
[edk2-devel] [Patch 02/16] Vlv2TbltDevicePkg/AcpiPlatform: Change Size type to UINTN
Posted by Michael D Kinney 6 years, 9 months ago
Change the type of the local variable Size in the function
AcpiPlatformEntryPoint() from UINT32 to UINTN.  This local
variable is passed into the function ReadSection() that returns
a value of type UINTN.  Using type UINT32 can potentially
corrupt an adjacent local on the stack.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index 0bd375391e..5c03f66edb 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2004  - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2004  - 2019, Intel Corporation. All rights reserved.<BR>
 
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -778,7 +778,7 @@ AcpiPlatformEntryPoint (
   EFI_ACPI_COMMON_HEADER        *CurrentTable;
   UINTN                         TableHandle;
   UINT32                        FvStatus;
-  UINT32                        Size;
+  UINTN                         Size;
   EFI_EVENT                     Event;
   EFI_ACPI_TABLE_VERSION        TableVersion;
   UINTN                         VarSize;
@@ -1223,7 +1223,7 @@ AcpiPlatformEntryPoint (
                       EFI_SECTION_RAW,
                       Instance,
                       (VOID **) &CurrentTable,
-                      (UINTN *) &Size,
+                      &Size,
                       &FvStatus
                       );
 
-- 
2.21.0.windows.1


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

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

Re: [edk2-devel] [Patch 02/16] Vlv2TbltDevicePkg/AcpiPlatform: Change Size type to UINTN
Posted by Sun, Zailiang 6 years, 9 months ago
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Thursday, May 9, 2019 12:31 PM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang <zailiang.sun@intel.com>; Qian, Yi <yi.qian@intel.com>
> Subject: [Patch 02/16] Vlv2TbltDevicePkg/AcpiPlatform: Change Size type to
> UINTN
> 
> Change the type of the local variable Size in the function
> AcpiPlatformEntryPoint() from UINT32 to UINTN.  This local variable is passed
> into the function ReadSection() that returns a value of type UINTN.  Using
> type UINT32 can potentially corrupt an adjacent local on the stack.
> 
> Cc: Zailiang Sun <zailiang.sun@intel.com>
> Cc: Yi Qian <yi.qian@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> index 0bd375391e..5c03f66edb 100644
> --- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> +++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -  Copyright (c) 2004  - 2018, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2004  - 2019, Intel Corporation. All rights
> + reserved.<BR>
> 
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent @@ -778,7 +778,7 @@
> AcpiPlatformEntryPoint (
>    EFI_ACPI_COMMON_HEADER        *CurrentTable;
>    UINTN                         TableHandle;
>    UINT32                        FvStatus;
> -  UINT32                        Size;
> +  UINTN                         Size;
>    EFI_EVENT                     Event;
>    EFI_ACPI_TABLE_VERSION        TableVersion;
>    UINTN                         VarSize;
> @@ -1223,7 +1223,7 @@ AcpiPlatformEntryPoint (
>                        EFI_SECTION_RAW,
>                        Instance,
>                        (VOID **) &CurrentTable,
> -                      (UINTN *) &Size,
> +                      &Size,
>                        &FvStatus
>                        );
> 
> --
> 2.21.0.windows.1


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

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

Re: [edk2-devel] [Patch 02/16] Vlv2TbltDevicePkg/AcpiPlatform: Change Size type to UINTN
Posted by Qian, Yi 6 years, 9 months ago
Reviewed by Qian, Yi <yi.qian@intel.com>

Thanks
QianYi

-----Original Message-----
From: Kinney, Michael D 
Sent: Thursday, May 9, 2019 12:31 PM
To: devel@edk2.groups.io
Cc: Sun, Zailiang <zailiang.sun@intel.com>; Qian, Yi <yi.qian@intel.com>
Subject: [Patch 02/16] Vlv2TbltDevicePkg/AcpiPlatform: Change Size type to UINTN

Change the type of the local variable Size in the function
AcpiPlatformEntryPoint() from UINT32 to UINTN.  This local variable is passed into the function ReadSection() that returns a value of type UINTN.  Using type UINT32 can potentially corrupt an adjacent local on the stack.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index 0bd375391e..5c03f66edb 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2004  - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2004  - 2019, Intel Corporation. All rights 
+ reserved.<BR>
 
 
   SPDX-License-Identifier: BSD-2-Clause-Patent @@ -778,7 +778,7 @@ AcpiPlatformEntryPoint (
   EFI_ACPI_COMMON_HEADER        *CurrentTable;
   UINTN                         TableHandle;
   UINT32                        FvStatus;
-  UINT32                        Size;
+  UINTN                         Size;
   EFI_EVENT                     Event;
   EFI_ACPI_TABLE_VERSION        TableVersion;
   UINTN                         VarSize;
@@ -1223,7 +1223,7 @@ AcpiPlatformEntryPoint (
                       EFI_SECTION_RAW,
                       Instance,
                       (VOID **) &CurrentTable,
-                      (UINTN *) &Size,
+                      &Size,
                       &FvStatus
                       );
 
--
2.21.0.windows.1



-- 
Qian Yi

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

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