public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 00/11] Test against invalid pointers in acpiview
@ 2019-08-15 13:11 Krzysztof Koch
  2019-08-15 13:11 ` [PATCH v1 01/11] ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields Krzysztof Koch
                   ` (13 more replies)
  0 siblings, 14 replies; 22+ messages in thread
From: Krzysztof Koch @ 2019-08-15 13:11 UTC (permalink / raw)
  To: devel; +Cc: jaben.carsey, ray.ni, zhichao.gao, Sami.Mujawar, Matteo.Carlini,
	nd

Prevent the use of invalid pointers when parsing ACPI tables in the UEFI
shell acpiview tool.

The parsing of ACPI tables is often controlled with the values read
earlier from the same table. For example, the 'Offset' or 'Count' fields
found in a structure are later used to parse the substructures. If such
fields lie outside the structure's buffer length provided, then there
is a possibility for a wild or dangling pointer.

Currently, if the ParseAcpi() function terminates early because the end
of the input table data buffer has been reached, then the pointers
which were supposed to be updated by this function are left untouched.
This is a security issue as the values pointed to by these pointers are
later used for flow control.

This patch series aims to solve this security issue by explicitly
initializing any pointers lying outside the input ACPI data buffer to
NULL and testing for NULL whenever these pointers are dereferenced.

Changes can be seet at: https://github.com/KrzysztofKoch1/edk2/tree/612_add_pointer_validation_v1

Krzysztof Koch (11):
  ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields
  ShellPkg: acpiview: RSDP: Validate global pointer before use
  ShellPkg: acpiview: FADT: Validate global pointer before use
  ShellPkg: acpiview: SLIT: Validate global pointer before use
  ShellPkg: acpiview: SLIT: Validate System Locality count
  ShellPkg: acpiview: SRAT: Validate global pointers before use
  ShellPkg: acpiview: MADT: Validate global pointers before use
  ShellPkg: acpiview: PPTT: Validate global pointers before use
  ShellPkg: acpiview: IORT: Validate global pointers before use
  ShellPkg: acpiview: GTDT: Validate global pointers before use
  ShellPkg: acpiview: DBG2: Validate global pointers before use

 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c              |  9 ++-
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c | 43 ++++++++++++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 14 +++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 37 ++++++++++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 52 +++++++++++++++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 13 +++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c | 25 ++++++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 12 ++++
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c | 61 ++++++++++++++++++--
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 13 +++++
 10 files changed, 272 insertions(+), 7 deletions(-)

--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-08-21  1:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-15 13:11 [PATCH v1 00/11] Test against invalid pointers in acpiview Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 01/11] ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fields Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 02/11] ShellPkg: acpiview: RSDP: Validate global pointer before use Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 03/11] ShellPkg: acpiview: FADT: " Krzysztof Koch
2019-08-16  7:34   ` Gao, Zhichao
2019-08-16 10:25     ` Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 04/11] ShellPkg: acpiview: SLIT: " Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 05/11] ShellPkg: acpiview: SLIT: Validate System Locality count Krzysztof Koch
2019-08-19  1:18   ` [edk2-devel] " Gao, Zhichao
2019-08-19  6:28     ` Krzysztof Koch
2019-08-19  7:16       ` Gao, Zhichao
2019-08-19  9:30   ` Sami Mujawar
2019-08-15 13:11 ` [PATCH v1 06/11] ShellPkg: acpiview: SRAT: Validate global pointers before use Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 07/11] ShellPkg: acpiview: MADT: " Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 08/11] ShellPkg: acpiview: PPTT: " Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 09/11] ShellPkg: acpiview: IORT: " Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 10/11] ShellPkg: acpiview: GTDT: " Krzysztof Koch
2019-08-15 13:11 ` [PATCH v1 11/11] ShellPkg: acpiview: DBG2: " Krzysztof Koch
2019-08-16  4:02 ` [edk2-devel] [PATCH v1 00/11] Test against invalid pointers in acpiview Liming Gao
2019-08-16  7:21   ` Krzysztof Koch
2019-08-19  9:29 ` Sami Mujawar
2019-08-21  1:46 ` [edk2-devel] " Gao, Zhichao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox