From 542b03d0a090d10d39da79a881787cbb013f1754 Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Tue, 30 Oct 2018 09:06:48 +0800 Subject: [PATCH] MdeModulePkg/UdfDxe: Check 'Component Type' within a Path Component REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1279 According to the ECMA-167 standard (3rd Edition - June 1997), Section 14.16.1.1, valid values are 1 to 5. All other values will be treated as a corrupted volume. This commit will add such check within function ResolveSymlink(). Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng Reviewed-by: Leif Lindholm --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index b9ebddfe62..fed3da1fa1 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -2257,6 +2257,13 @@ ResolveSymlink ( } FileName[Index] = L'\0'; break; + default: + // + // According to the ECMA-167 standard (3rd Edition - June 1997), Section + // 14.16.1.1, all other values are reserved. + // + Status = EFI_VOLUME_CORRUPTED; + goto Error_Find_File; } //