FreeBSD Bugzilla – Attachment 153374 Details for
Bug 197641
[PATCH] UEFI loader creates invalid device path
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch which avoids modification of firmware-allocated structures
efipart.c.patch (text/plain), 1.65 KB, created by
Chris Ruffin
on 2015-02-23 15:04:27 UTC
(
hide
)
Description:
patch which avoids modification of firmware-allocated structures
Filename:
MIME Type:
Creator:
Chris Ruffin
Created:
2015-02-23 15:04:27 UTC
Size:
1.65 KB
patch
obsolete
>--- sys/boot/efi/libefi/efipart.c.orig 2001-01-01 02:32:38.000000000 -0500 >+++ sys/boot/efi/libefi/efipart.c 2015-02-22 23:01:57.000000000 -0500 >@@ -63,13 +63,14 @@ > efipart_init(void) > { > EFI_BLOCK_IO *blkio; >- EFI_DEVICE_PATH *devpath, *node; >+ EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node; > EFI_HANDLE *hin, *hout, *aliases, handle; > EFI_STATUS status; > UINTN sz; > CHAR16 *path; > u_int n, nin, nout; > int err; >+ size_t devpathlen; > > sz = 0; > hin = NULL; >@@ -98,9 +99,15 @@ > if (EFI_ERROR(status)) { > continue; > } >+ > node = devpath; >- while (!IsDevicePathEnd(NextDevicePathNode(node))) >+ devpathlen = DevicePathNodeLength(node); >+ while (!IsDevicePathEnd(NextDevicePathNode(node))) { > node = NextDevicePathNode(node); >+ devpathlen += DevicePathNodeLength(node); >+ } >+ devpathlen += DevicePathNodeLength(NextDevicePathNode(node)); >+ > status = BS->HandleProtocol(hin[n], &blkio_guid, > (void**)&blkio); > if (EFI_ERROR(status)) >@@ -117,10 +124,16 @@ > */ > if (DevicePathType(node) == MEDIA_DEVICE_PATH && > DevicePathSubType(node) == MEDIA_CDROM_DP) { >- node->Type = END_DEVICE_PATH_TYPE; >- node->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; >- status = BS->LocateDevicePath(&blkio_guid, &devpath, >+ devpathcpy = malloc(devpathlen); >+ memcpy(devpathcpy, devpath, devpathlen); >+ node = devpathcpy; >+ while (!IsDevicePathEnd(NextDevicePathNode(node))) >+ node = NextDevicePathNode(node); >+ SetDevicePathEndNode(node); >+ tmpdevpath = devpathcpy; >+ status = BS->LocateDevicePath(&blkio_guid, &tmpdevpath, > &handle); >+ free(devpathcpy); > if (EFI_ERROR(status)) > continue; > hout[nout] = handle;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197641
:
152971
|
152972
| 153374