|
BOOLEAN | PartitionValidGptTable (IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_LBA Lba, OUT EFI_PARTITION_TABLE_HEADER *PartHeader) |
|
BOOLEAN | PartitionCheckGptEntryArrayCRC (IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_PARTITION_TABLE_HEADER *PartHeader) |
|
BOOLEAN | PartitionRestoreGptTable (IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_PARTITION_TABLE_HEADER *PartHeader) |
|
VOID | PartitionCheckGptEntry (IN EFI_PARTITION_TABLE_HEADER *PartHeader, IN EFI_PARTITION_ENTRY *PartEntry, OUT EFI_PARTITION_ENTRY_STATUS *PEntryStatus) |
|
BOOLEAN | PartitionCheckCrcAltSize (IN UINTN MaxSize, IN UINTN Size, IN OUT EFI_TABLE_HEADER *Hdr) |
|
BOOLEAN | PartitionCheckCrc (IN UINTN MaxSize, IN OUT EFI_TABLE_HEADER *Hdr) |
|
VOID | PartitionSetCrcAltSize (IN UINTN Size, IN OUT EFI_TABLE_HEADER *Hdr) |
|
VOID | PartitionSetCrc (IN OUT EFI_TABLE_HEADER *Hdr) |
|
EFI_STATUS | PartitionInstallGptChildHandles (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Handle, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_DISK_IO2_PROTOCOL *DiskIo2, IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_BLOCK_IO2_PROTOCOL *BlockIo2, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
|
Decode a hard disk partitioned with the GPT scheme in the UEFI 2.0 specification.
Caution: This file requires additional review when modified. This driver will have external input - disk partition. This external input must be validated carefully to avoid security issue like buffer overflow, integer overflow.
PartitionInstallGptChildHandles() routine will read disk partition content and do basic validation before PartitionInstallChildHandle().
PartitionValidGptTable(), PartitionCheckGptEntry() routine will accept disk partition content and validate the GPT table and GPT entry.
Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc. Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Gpt.c.
EFI_STATUS PartitionInstallGptChildHandles |
( |
IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
|
|
IN EFI_HANDLE | Handle, |
|
|
IN EFI_DISK_IO_PROTOCOL * | DiskIo, |
|
|
IN EFI_DISK_IO2_PROTOCOL * | DiskIo2, |
|
|
IN EFI_BLOCK_IO_PROTOCOL * | BlockIo, |
|
|
IN EFI_BLOCK_IO2_PROTOCOL * | BlockIo2, |
|
|
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath ) |
Install child handles if the Handle supports GPT partition structure.
Caution: This function may receive untrusted input. The GPT partition table is external input, so this routine will do basic validation for GPT partition table before install child handle for each GPT partition.
- Parameters
-
[in] | This | Calling context. |
[in] | Handle | Parent Handle. |
[in] | DiskIo | Parent DiskIo interface. |
[in] | DiskIo2 | Parent DiskIo2 interface. |
[in] | BlockIo | Parent BlockIo interface. |
[in] | BlockIo2 | Parent BlockIo2 interface. |
[in] | DevicePath | Parent Device Path. |
- Return values
-
EFI_SUCCESS | Valid GPT disk. |
EFI_MEDIA_CHANGED | Media changed Detected. |
other | Not a valid GPT disk. |
Definition at line 186 of file Gpt.c.
BOOLEAN PartitionValidGptTable |
( |
IN EFI_BLOCK_IO_PROTOCOL * | BlockIo, |
|
|
IN EFI_DISK_IO_PROTOCOL * | DiskIo, |
|
|
IN EFI_LBA | Lba, |
|
|
OUT EFI_PARTITION_TABLE_HEADER * | PartHeader ) |
Install child handles if the Handle supports GPT partition structure.
Caution: This function may receive untrusted input. The GPT partition table header is external input, so this routine will do basic validation for GPT partition table header before return.
- Parameters
-
[in] | BlockIo | Parent BlockIo interface. |
[in] | DiskIo | Disk Io protocol. |
[in] | Lba | The starting Lba of the Partition Table |
[out] | PartHeader | Stores the partition table that is read |
- Return values
-
TRUE | The partition table is valid |
FALSE | The partition table is not valid |
This routine will read GPT partition table header and return it.
Caution: This function may receive untrusted input. The GPT partition table header is external input, so this routine will do basic validation for GPT partition table header before return.
- Parameters
-
[in] | BlockIo | Parent BlockIo interface. |
[in] | DiskIo | Disk Io protocol. |
[in] | Lba | The starting Lba of the Partition Table |
[out] | PartHeader | Stores the partition table that is read |
- Return values
-
TRUE | The partition table is valid |
FALSE | The partition table is not valid |
Definition at line 482 of file Gpt.c.