Skip to content

Commit bd8ec21

Browse files
gapandyamergify[bot]
authored andcommitted
ShellPkg/AcpiView: Avoid mutating HEST hardware bank count during parse
Remove post-parse write to mHestIA32HardwareBankCount. Keep HEST parsing read-only. *mHestIA32HardwareBankCount = 0, line in code corrupts the ACPI HEST table data Hardware bank count to zero. mHestIA32HardwareBankCount points into the parsed HEST table data (input buffer). Writing through it modifies ACPI table contents during parsing, which should be read-only behavior. Signed-off-by: Gaurav Pandya <Gaurav.Pandya@amd.com>
1 parent 35c03c1 commit bd8ec21

File tree

1 file changed

+4
-5
lines changed
  • ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hest

1 file changed

+4
-5
lines changed

ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hest/HestParser.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
HEST table parser
33
44
Copyright (c) 2024, Arm Limited.
5+
Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved.<BR>
56
SPDX-License-Identifier: BSD-2-Clause-Patent
67
78
@par Specification Reference:
@@ -16,9 +17,9 @@
1617
#include "AcpiView.h"
1718

1819
STATIC ACPI_DESCRIPTION_HEADER_INFO mAcpiHdrInfo;
19-
STATIC UINT32 *mHestErrorSourceCount;
20-
STATIC UINT16 *mHestErrorSourceType;
21-
STATIC UINT8 *mHestIA32HardwareBankCount;
20+
STATIC CONST UINT32 *mHestErrorSourceCount;
21+
STATIC CONST UINT16 *mHestErrorSourceType;
22+
STATIC CONST UINT8 *mHestIA32HardwareBankCount;
2223

2324
/**
2425
An String array for Error Notification Structure's type.
@@ -551,8 +552,6 @@ DumpIA32ArchMachineCheckErrorBankStructure (
551552
sizeof (EFI_ACPI_6_5_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE);
552553
}
553554

554-
*mHestIA32HardwareBankCount = 0;
555-
556555
return EFI_SUCCESS;
557556
}
558557

0 commit comments

Comments
 (0)