]> git.proxmox.com Git - mirror_edk2.git/commit
ShellPkg: acpiview: IORT: Prevent buffer overruns
authorKrzysztof Koch <krzysztof.koch@arm.com>
Thu, 1 Aug 2019 23:44:04 +0000 (16:44 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Mon, 12 Aug 2019 17:13:49 +0000 (10:13 -0700)
commit62cefaf44e1cc14376e547e955a846ba456caa93
treee3aaa7a7d5331718f0d86893f9dbf6de2d08f2ba
parent1d12f0e671550b7a1ac8f2ce282779069b94073c
ShellPkg: acpiview: IORT: Prevent buffer overruns

Modify the IORT table parsing logic to prevent reading past the buffer
lengths provided.

Change DumpIortNodeIdMappings() function's signature and implementation
to simplify buffer overrun prevention. Update all calls to this
function accordingly.

Modify the parser for each type of IORT node such that the offset from
the start of the node's buffer is tracked as the parsing function is
executed. Again, this change helps prevent buffer overruns.

Test that the IORT node buffer fits in the table buffer before the
node's buffer contents are dumped.

References:
- IO Remapping Table (Issue D), Platform Design Document, March 2018

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>
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c