public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms] [PATCH] KabylakeSiliconPkg: Possible out-of-bounds memory writes
@ 2019-07-15 20:39 Nate DeSimone
  2019-07-15 23:17 ` Chaganty, Rangasai V
  2019-07-16  0:07 ` Chiu, Chasel
  0 siblings, 2 replies; 3+ messages in thread
From: Nate DeSimone @ 2019-07-15 20:39 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Michael A Kubacki, Sai Chaganty

- Add check for the DSDT not existing.
- Fixed logic errors in loop boundary check.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Michael A Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>

Co-authored-by: John Mathews <john.mathews@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 .../Library/DxeAslUpdateLib/DxeAslUpdateLib.c               | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c
index e6ab43db6d..a9611f750f 100644
--- a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c
+++ b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c
@@ -59,6 +59,7 @@ InitializeAslUpdateLib (
   @param[in] Length            - length of data to be overwritten
 
   @retval EFI_SUCCESS          - The function completed successfully.
+  @retval EFI_NOT_FOUND        - Failed to locate AcpiTable.
 **/
 EFI_STATUS
 UpdateNameAslCode (
@@ -99,11 +100,14 @@ UpdateNameAslCode (
   /// Point to the beginning of the DSDT table
   ///
   CurrPtr = (UINT8 *) Table;
+  if (CurrPtr == NULL) {
+    return EFI_NOT_FOUND;
+  }
 
   ///
   /// Loop through the ASL looking for values that we must fix up.
   ///
-  for (DsdtPointer = CurrPtr; DsdtPointer <= (CurrPtr + ((EFI_ACPI_COMMON_HEADER *) CurrPtr)->Length); DsdtPointer++) {
+  for (DsdtPointer = CurrPtr; DsdtPointer < (CurrPtr + ((EFI_ACPI_COMMON_HEADER *) CurrPtr)->Length); DsdtPointer++) {
     ///
     /// Get a pointer to compare for signature
     ///
-- 
2.17.1.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-16  0:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-15 20:39 [edk2-platforms] [PATCH] KabylakeSiliconPkg: Possible out-of-bounds memory writes Nate DeSimone
2019-07-15 23:17 ` Chaganty, Rangasai V
2019-07-16  0:07 ` Chiu, Chasel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox