audk/ShellPkg/Library/UefiShellAcpiViewCommandLib
Krzysztof Koch b85048261a ShellPkg: acpiview: Prevent infinite loop if structure length is 0
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2534

Extend validation of ACPI structure lengths which are read from the
ACPI table being parsed. Additionally check if the structure 'Length'
field value is positive. If not, stop parsing the faulting table.

Some ACPI tables define internal structures of variable size. The
'Length' field inside the substructure is used to update a pointer used
for table traversal. If the byte-length of the structure is equal to 0,
acpiview can enter an infinite loop. This condition can occur if, for
example, the zero-allocated ACPI table buffer is not fully populated.
This is typically a bug on the ACPI table writer side.

In short, this method helps acpiview recover gracefully from a
zero-valued ACPI structure length.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2020-02-20 09:27:00 +00:00
..
Parsers ShellPkg: acpiview: Prevent infinite loop if structure length is 0 2020-02-20 09:27:00 +00:00
AcpiParser.c ShellPkg: acpiview: Remove duplicate ACPI structure size definitions 2020-02-19 06:01:39 +00:00
AcpiParser.h ShellPkg: acpiview: Remove duplicate ACPI structure size definitions 2020-02-19 06:01:39 +00:00
AcpiTableParser.c ShellPkg: acpiview: Validate ACPI table 'Length' field 2020-02-19 06:01:39 +00:00
AcpiTableParser.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
AcpiView.c ShellPkg/UefiShellAcpiViewCommandLib: Initialize local variables 2019-08-16 14:01:49 +08:00
AcpiView.h ShellPkg: acpiview: Allow disabling consistency checks (-q flag) 2019-07-02 17:22:45 +08:00
UefiShellAcpiViewCommandLib.c ShellPkg: acpiview: Add support for parsing FACS 2019-12-05 06:12:36 +00:00
UefiShellAcpiViewCommandLib.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
UefiShellAcpiViewCommandLib.inf ShellPkg: acpiview: Add support for parsing FACS 2019-12-05 06:12:36 +00:00
UefiShellAcpiViewCommandLib.uni ShellPkg: acpiview: Make '-h' option not require a parameter 2019-07-02 17:22:46 +08:00