diff options
author | Jose Luis Duran <jlduran@gmail.com> | 2022-02-25 14:39:12 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2022-02-27 16:11:59 +0000 |
commit | b782b7884c8aa19cb2dcb6ece6909e9f05173d72 (patch) | |
tree | 7bd8fb40dd55166592e1e12d1aa72f253fa804f5 | |
parent | 81a659e364e2ee84dd3220c0f87fb9add8fbfbed (diff) | |
download | src-b782b7884c8aa19cb2dcb6ece6909e9f05173d72.tar.gz src-b782b7884c8aa19cb2dcb6ece6909e9f05173d72.zip |
libefivar: Fix FromText bug for multi-instance devicepath
UefiDevicePathLibConvertTextToDevicePath correctly detects when it
has hit a ',' splicing together multiple paths. However, the code
that tries to cope with it:
{code}
if (IsInstanceEnd) {
DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (
END_DEVICE_PATH_LENGTH);
ASSERT (DeviceNode != NULL);
SetDevicePathEndNode (DeviceNode);
NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode);
FreePool (DevicePath);
FreePool (DeviceNode);
DevicePath = NewDevicePath;
}
{code}
causes a problem. The END node that's appended it the node for the
entire list. So when the node is appended in AppendDevicePathNode,
it winds up disappearing. This leads to the path
'PciRoot(0x0),PciRoot(0x0)' parsing as if 'PciRoot(0x0)/PciRoot(0x0)'
were specified. These are two very different things.
NOTE:
This fix was already committed. It has been included with the sole
intention of reducing diffs with upstream.
Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=419
Obtained from: https://github.com/tianocore/edk2/commit/647636e1750b07110ed807f455cb9c8b7d089f75
Pull Request: https://github.com/freebsd/freebsd-src/pull/581
-rw-r--r-- | lib/libefivar/efivar-dp-parse.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/libefivar/efivar-dp-parse.c b/lib/libefivar/efivar-dp-parse.c index 4040b001708d..82f9c6027d32 100644 --- a/lib/libefivar/efivar-dp-parse.c +++ b/lib/libefivar/efivar-dp-parse.c @@ -3680,7 +3680,6 @@ UefiDevicePathLibConvertTextToDevicePath ( DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH); ASSERT (DeviceNode != NULL); SetDevicePathEndNode (DeviceNode); - // Fix from https://bugzilla.tianocore.org/show_bug.cgi?id=419 DeviceNode->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode); |