public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator
@ 2019-05-08 14:05 Krzysztof Koch
  2019-05-15  9:34 ` [edk2-devel] " Alexei.Fedorov
  2019-06-10 18:59 ` Sami Mujawar
  0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Koch @ 2019-05-08 14:05 UTC (permalink / raw)
  To: devel
  Cc: ard.biesheuvel, Sami.Mujawar, Alexei.Fedorov, Girish.Pathak,
	Pierre.Gondois, Matteo.Carlini, Stephanie.Hughes-Fitt, nd

Added code to check if the Generic Timer Block Structure's frame number
provided by the platform repository is within the allowed range (0-7).

References:
- ACPI 6.2 Errata A, Table 5-122, September 2017

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
---

The changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/woa_522_gt_frame_number_validate_v1

Notes:
    v1:
    - Add GTDT Frame Number validation [Krzysztof]

 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
index 8d9ddcf9244b9f8b795edf7a53dd8a071bb121bc..543e6f442f2ab93bc7c9cd5e563d305c0f400060 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
@@ -218,6 +218,15 @@ AddGTBlockTimerFrames (
       GtBlockFrame
       ));

+    if (GTBlockTimerFrameList->FrameNumber >= 8) {
+      DEBUG ((
+        DEBUG_ERROR,
+        "ERROR: GTDT: Frame number %d is not in the range 0-7\n",
+        GTBlockTimerFrameList->FrameNumber
+      ));
+      return EFI_INVALID_PARAMETER;
+    }
+
     GtBlockFrame->GTFrameNumber = GTBlockTimerFrameList->FrameNumber;
     GtBlockFrame->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
     GtBlockFrame->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [edk2-devel] [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator
  2019-05-08 14:05 [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator Krzysztof Koch
@ 2019-05-15  9:34 ` Alexei.Fedorov
  2019-06-10 18:59 ` Sami Mujawar
  1 sibling, 0 replies; 4+ messages in thread
From: Alexei.Fedorov @ 2019-05-15  9:34 UTC (permalink / raw)
  To: Krzysztof Koch, devel

[-- Attachment #1: Type: text/plain, Size: 54 bytes --]

Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>

[-- Attachment #2: Type: text/html, Size: 60 bytes --]

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

* Re: [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator
  2019-05-08 14:05 [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator Krzysztof Koch
  2019-05-15  9:34 ` [edk2-devel] " Alexei.Fedorov
@ 2019-06-10 18:59 ` Sami Mujawar
  2019-06-10 19:41   ` Sami Mujawar
  1 sibling, 1 reply; 4+ messages in thread
From: Sami Mujawar @ 2019-06-10 18:59 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: nd

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

-----Original Message-----
From: Krzysztof Koch <krzysztof.koch@arm.com> 
Sent: 08 May 2019 03:05 PM
To: devel@edk2.groups.io
Cc: ard.biesheuvel@linaro.org; Sami Mujawar <Sami.Mujawar@arm.com>; Alexei Fedorov <Alexei.Fedorov@arm.com>; Girish Pathak <Girish.Pathak@arm.com>; Pierre Gondois <Pierre.Gondois@arm.com>; Matteo Carlini <Matteo.Carlini@arm.com>; Stephanie Hughes-Fitt <Stephanie.Hughes-Fitt@arm.com>; nd <nd@arm.com>
Subject: [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator

Added code to check if the Generic Timer Block Structure's frame number provided by the platform repository is within the allowed range (0-7).

References:
- ACPI 6.2 Errata A, Table 5-122, September 2017

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
---

The changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/woa_522_gt_frame_number_validate_v1

Notes:
    v1:
    - Add GTDT Frame Number validation [Krzysztof]

 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
index 8d9ddcf9244b9f8b795edf7a53dd8a071bb121bc..543e6f442f2ab93bc7c9cd5e563d305c0f400060 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
@@ -218,6 +218,15 @@ AddGTBlockTimerFrames (
       GtBlockFrame
       ));
 
+    if (GTBlockTimerFrameList->FrameNumber >= 8) {
+      DEBUG ((
+        DEBUG_ERROR,
+        "ERROR: GTDT: Frame number %d is not in the range 0-7\n",
+        GTBlockTimerFrameList->FrameNumber
+      ));
+      return EFI_INVALID_PARAMETER;
+    }
+
     GtBlockFrame->GTFrameNumber = GTBlockTimerFrameList->FrameNumber;
     GtBlockFrame->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
     GtBlockFrame->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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

* Re: [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator
  2019-06-10 18:59 ` Sami Mujawar
@ 2019-06-10 19:41   ` Sami Mujawar
  0 siblings, 0 replies; 4+ messages in thread
From: Sami Mujawar @ 2019-06-10 19:41 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: nd

Pushed as 98f98eb440d6..75bf10a68914

-----Original Message-----
From: Sami Mujawar 
Sent: 10 June 2019 07:59 PM
To: devel@edk2.groups.io
Cc: nd <nd@arm.com>
Subject: RE: [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

-----Original Message-----
From: Krzysztof Koch <krzysztof.koch@arm.com> 
Sent: 08 May 2019 03:05 PM
To: devel@edk2.groups.io
Cc: ard.biesheuvel@linaro.org; Sami Mujawar <Sami.Mujawar@arm.com>; Alexei Fedorov <Alexei.Fedorov@arm.com>; Girish Pathak <Girish.Pathak@arm.com>; Pierre Gondois <Pierre.Gondois@arm.com>; Matteo Carlini <Matteo.Carlini@arm.com>; Stephanie Hughes-Fitt <Stephanie.Hughes-Fitt@arm.com>; nd <nd@arm.com>
Subject: [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator

Added code to check if the Generic Timer Block Structure's frame number provided by the platform repository is within the allowed range (0-7).

References:
- ACPI 6.2 Errata A, Table 5-122, September 2017

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
---

The changes can be seen at: https://github.com/KrzysztofKoch1/edk2/tree/woa_522_gt_frame_number_validate_v1

Notes:
    v1:
    - Add GTDT Frame Number validation [Krzysztof]

 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
index 8d9ddcf9244b9f8b795edf7a53dd8a071bb121bc..543e6f442f2ab93bc7c9cd5e563d305c0f400060 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
@@ -218,6 +218,15 @@ AddGTBlockTimerFrames (
       GtBlockFrame
       ));
 
+    if (GTBlockTimerFrameList->FrameNumber >= 8) {
+      DEBUG ((
+        DEBUG_ERROR,
+        "ERROR: GTDT: Frame number %d is not in the range 0-7\n",
+        GTBlockTimerFrameList->FrameNumber
+      ));
+      return EFI_INVALID_PARAMETER;
+    }
+
     GtBlockFrame->GTFrameNumber = GTBlockTimerFrameList->FrameNumber;
     GtBlockFrame->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
     GtBlockFrame->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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

end of thread, other threads:[~2019-06-10 19:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08 14:05 [PATCH v1 1/1] DynamicTablesPkg: Add frame number validation to GTDT generator Krzysztof Koch
2019-05-15  9:34 ` [edk2-devel] " Alexei.Fedorov
2019-06-10 18:59 ` Sami Mujawar
2019-06-10 19:41   ` Sami Mujawar

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