]> git.proxmox.com Git - mirror_edk2.git/commit
ShellPkg: acpiview: MADT: Split structure length validation
authorKrzysztof Koch <krzysztof.koch@arm.com>
Mon, 22 Jul 2019 22:50:25 +0000 (15:50 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Wed, 31 Jul 2019 16:52:57 +0000 (09:52 -0700)
commitd23bf7973491938d479bef5535c9017dc9065e58
tree6e54a84762a1ef0cf7f689b4669774e1bb5db7fb
parent748c1efd1e0d934c68b6dafd3011aee47c25ad57
ShellPkg: acpiview: MADT: Split structure length validation

Split the Interrupt Controller Structure length validation in the
acpiview UEFI shell tool into two logical parts:
1. Ensuring MADT table parser forward progress.
2. Preventing MADT table buffer overruns.

Also, make the condition for infinite loop detection applicable to
all types of Interrupt Controller Structures (for all interrupt models
which can be represented in MADT). Check if the controller length
specified is shorter than the byte size of the first two fields
('Type' and 'Length') present in every valid Interrupt Controller
Structure.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c