mirror_edk2/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers
Krzysztof Koch 1d12f0e671 ShellPkg: acpiview: GTDT: Prevent buffer overruns
Modify the GTDT table parsing logic to prevent reading past the ACPI
buffer lengths provided and to make it consistent with other table
parsers. This includes converting the do-while loop in ParseAcpiGtdt()
into a while loop.

Remove a check which ensures that the entire Platform GT Block
Structure buffer has been parsed. The ACPI specification does not ban
from defining buffers which are larger than the size indicated by the
count and sizes of substructures which constitute it.

Change the data type of the Length parameter to the DumpGTBlock()
function to reflect the width of the respective ACPI structure's
field.

References:
- ACPI 6.3, January 2019, Table 5-124

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@inte.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2019-08-12 10:13:46 -07:00
..
Bgrt ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Dbg2 ShellPkg: acpiview: DBG2: Prevent buffer overruns 2019-08-12 10:13:41 -07:00
Dsdt ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Fadt ShellPkg: acpiview: FADT: Remove redundant forward declarations 2019-07-19 08:32:43 -07:00
Gtdt ShellPkg: acpiview: GTDT: Prevent buffer overruns 2019-08-12 10:13:46 -07:00
Iort ShellPkg: acpiview: IORT: Refactor PMCG node mapping count validation 2019-07-31 09:53:00 -07:00
Madt ShellPkg: acpiview: MADT: Split structure length validation 2019-07-31 09:52:57 -07:00
Mcfg ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Pptt ShellPkg: acpiview: Improve PPTT table field validation 2019-07-02 17:21:59 +08:00
Rsdp ShellPkg: acpiview: RSDP: Make code consistent with other parsers 2019-07-31 09:52:50 -07:00
Slit ShellPkg/AcpiView: Fix IA32 link error 2019-08-05 14:18:10 -07:00
Spcr ShellPkg: acpiview: SPCR: Remove redundant forward declaration 2019-07-19 08:32:49 -07:00
Srat ShellPkg: acpiview: SRAT: Minor code style enhancements 2019-07-31 09:52:53 -07: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