From: "Krzysztof Koch" <krzysztof.koch@arm.com>
To: "Gao, Zhichao" <zhichao.gao@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Carsey, Jaben" <jaben.carsey@intel.com>,
"Ni, Ray" <ray.ni@intel.com>, Sami Mujawar <Sami.Mujawar@arm.com>,
Matteo Carlini <Matteo.Carlini@arm.com>, nd <nd@arm.com>
Subject: Re: [PATCH v1 03/11] ShellPkg: acpiview: FADT: Validate global pointer before use
Date: Fri, 16 Aug 2019 10:25:16 +0000 [thread overview]
Message-ID: <VE1PR08MB47831E440748BF089954BF7484AF0@VE1PR08MB4783.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <3CE959C139B4C44DBEA1810E3AA6F9000B823290@SHSMSX101.ccr.corp.intel.com>
Hi Zhichao,
I think you're right. I will submit a v2 patch that minimizes the amount of pointer validation required for parsing the remaining tables.
Kind regards,
Krzysztof
-----Original Message-----
From: Gao, Zhichao <zhichao.gao@intel.com>
Sent: Friday, August 16, 2019 8:35
To: Krzysztof Koch <Krzysztof.Koch@arm.com>; devel@edk2.groups.io
Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ray <ray.ni@intel.com>; Sami Mujawar <Sami.Mujawar@arm.com>; Matteo Carlini <Matteo.Carlini@arm.com>; nd <nd@arm.com>
Subject: RE: [PATCH v1 03/11] ShellPkg: acpiview: FADT: Validate global pointer before use
For FadtMinorRevision and X_DsdtAddress, I don't think they are required section. Maybe we should consider check the length before check them. As I know, the OVMF's FACP table doesn't have the section after flag.
Thanks,
Zhichao
> -----Original Message-----
> From: Krzysztof Koch [mailto:krzysztof.koch@arm.com]
> Sent: Thursday, August 15, 2019 9:11 PM
> To: devel@edk2.groups.io
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ray
> <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>;
> Sami.Mujawar@arm.com; Matteo.Carlini@arm.com; nd@arm.com
> Subject: [PATCH v1 03/11] ShellPkg: acpiview: FADT: Validate global
> pointer before use
>
> Check if global pointers have been successfully updated before they
> are used for further table parsing.
>
> Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
> ---
>
> Notes:
> v1:
> - Test against NULL pointers [Krzysztof]
>
>
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
> | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.
> c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.
> c
> index
> e40c9ef8ee4b3285faf8c6edf3cb6236ee367397..e218e45926abced1096e75441
> e22108db7a3a811 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.
> c
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtPars
> +++ er.c
> @@ -203,6 +203,20 @@ ParseAcpiFadt (
> PARSER_PARAMS (FadtParser)
> );
>
> + // Check if the values used to control the parsing logic have been
> + // successfully read.
> + if ((DsdtAddress == NULL) ||
> + (FadtMinorRevision == NULL) ||
> + (X_DsdtAddress == NULL)) {
> + IncrementErrorCount ();
> + Print (
> + L"ERROR: Insufficient table length. AcpiTableLength = %d. " \
> + L"FADT parsing aborted.\n",
> + AcpiTableLength
> + );
> + return;
> + }
> +
> if (Trace) {
> Print (L"\nSummary:\n");
> PrintFieldName (2, L"FADT Version");
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
>
next prev parent reply other threads:[~2019-08-16 10:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=VE1PR08MB47831E440748BF089954BF7484AF0@VE1PR08MB4783.eurprd08.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox