/** @file\r
Scan for an UDF file system on a formatted media.\r
\r
+ Caution: This file requires additional review when modified.\r
+ This driver will have external input - CD/DVD media.\r
+ This external input must be validated carefully to avoid security issue like\r
+ buffer overflow, integer overflow.\r
+\r
+ FindUdfFileSystem() routine will consume the media properties and do basic\r
+ validation.\r
+\r
Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.\r
Copyright (C) 2014-2017 Paulo Alcantara <pcacjr@zytor.com>\r
+ Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
*LastRecordedBlock = EndLBA;\r
AvdpsCount = 0;\r
\r
+ //\r
+ // Check if the block size of the underlying media can hold the data of an\r
+ // Anchor Volume Descriptor Pointer\r
+ //\r
+ if (BlockSize < sizeof (UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER)) {\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ "%a: Media block size 0x%x unable to hold an AVDP.\n",\r
+ __FUNCTION__,\r
+ BlockSize\r
+ ));\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Find AVDP at block 256\r
//\r
/**\r
Find a supported UDF file system in block device.\r
\r
+ @attention This is boundary function that may receive untrusted input.\r
+ @attention The input is from Partition.\r
+\r
+ The CD/DVD media is the external input, so this routine will do basic\r
+ validation for the media.\r
+\r
@param[in] BlockIo BlockIo interface.\r
@param[in] DiskIo DiskIo interface.\r
@param[out] StartingLBA UDF file system starting LBA.\r