summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2021-04-09 13:00:58 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-04-13 10:38:14 +0000
commit16136f218d546f458afb8037482962242e95aed4 (patch)
tree0c457b11a25a79fcafdeda9663d8725381d3a4b5 /DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
parent54211ab10fcd8532b49f4024ebdb601a8eb07e3e (diff)
downloadedk2-16136f218d546f458afb8037482962242e95aed4.tar.gz
edk2-16136f218d546f458afb8037482962242e95aed4.tar.bz2
edk2-16136f218d546f458afb8037482962242e95aed4.zip
DynamicTablesPkg: add validation for PcdNonBsaCompliant16550SerialHid
According to ACPI 6.4, 6.1.5 _HID states: - A valid PNP ID must be of the form "AAA####" where A is an uppercase letter and # is a hex digit. - A valid ACPI ID must be of the form "NNNN####" where N is an uppercase letter or a digit ('0'-'9') and # is a hex digit. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c')
-rw-r--r--DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c b/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
index 3c4356097c..f2b4831ad5 100644
--- a/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
+++ b/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
@@ -148,6 +148,10 @@ FixupIds (
// If there is a non-BSA compliant HID, use that.
NonBsaHid = (CONST CHAR8*)PcdGetPtr (PcdNonBsaCompliant16550SerialHid);
if ((NonBsaHid != NULL) && (AsciiStrLen (NonBsaHid) != 0)) {
+ if (!(IsValidPnpId (NonBsaHid) || IsValidAcpiId (NonBsaHid))) {
+ return EFI_INVALID_PARAMETER;
+ }
+
HidString = NonBsaHid;
CidString = "";
} else {