audk/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers
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
..
Bgrt ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Dbg2 ShellPkg: acpiview: Prevent infinite loop if structure length is 0 2020-02-20 09:27:00 +00:00
Dsdt ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Facs ShellPkg: acpiview: Add support for parsing FACS 2019-12-05 06:12:36 +00:00
Fadt ShellPkg: acpiview: FADT: Validate global pointer before use 2020-02-11 02:12:45 +00:00
Gtdt ShellPkg: acpiview: Prevent infinite loop if structure length is 0 2020-02-20 09:27:00 +00:00
Iort ShellPkg: acpiview: Prevent infinite loop if structure length is 0 2020-02-20 09:27:00 +00:00
Madt ShellPkg: acpiview: Prevent infinite loop if structure length is 0 2020-02-20 09:27:00 +00:00
Mcfg ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Pptt ShellPkg: acpiview: Prevent infinite loop if structure length is 0 2020-02-20 09:27:00 +00:00
Rsdp ShellPkg: acpiview: RSDP: Validate global pointer before use 2020-02-11 02:12:45 +00:00
Slit ShellPkg: acpiview: SLIT: Validate System Locality count 2020-02-11 02:12:45 +00:00
Spcr ShellPkg: acpiview: SPCR: Remove redundant forward declaration 2019-07-19 08:32:49 -07:00
Srat ShellPkg: acpiview: Prevent infinite loop if structure length is 0 2020-02-20 09:27:00 +00:00
Ssdt ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Xsdt ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call 2019-07-31 09:52:47 -07:00