From nobody Sun Feb 27 16:47:35 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8205119E95C6; Sun, 27 Feb 2022 16:47:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K68ZJ1Rbmz4m2H; Sun, 27 Feb 2022 16:47:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645980456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YztUCa7qVrSJok+qSnCbmiHocVwuEcKvuPhV5I+Q6mk=; b=qACm+XmFlVZwnaeuhYdbX2ccj8bY4JUj0+f+kRnP5xMAhKotQK7yKLFMBQqFao3v2O2Brc HUkMzcgpii+fc+qu6sR1HkhkA0spR0k74ptT3Yr8kvlvYp1auGeLcRI/u1lFnGGR/w2qYX E7mVUNWvR3/q4Y06Z5YoFRal+fNarPf+knvEK7X5cDTvuzq4TLmndmQX+0K25biFUDLhF/ C11I7psFxdEXPQeRf4bKpP/mMmYTNmRvdLAaboydds8y8f+sQwkdSnKC2QKtiLT5U8JzKS 7kkCs9SBfXPUvtFRcqXrkLQz+UbZ3iqi73vQzjGfYWR9+0ipm8bQVRwN5ud/yA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E21FD2D2A; Sun, 27 Feb 2022 16:47:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21RGlZCJ036648; Sun, 27 Feb 2022 16:47:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21RGlZo1036647; Sun, 27 Feb 2022 16:47:35 GMT (envelope-from git) Date: Sun, 27 Feb 2022 16:47:35 GMT Message-Id: <202202271647.21RGlZo1036647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b782b7884c8a - main - libefivar: Fix FromText bug for multi-instance devicepath List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b782b7884c8aa19cb2dcb6ece6909e9f05173d72 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645980456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YztUCa7qVrSJok+qSnCbmiHocVwuEcKvuPhV5I+Q6mk=; b=xFbULyFkOcJU6GY7xUlEJxYSE/60Jiij3ypH+MLaWoC6BmHSeCZoAEOkcTOwzp90LZAnee 808Gj3BfIm3YRQ19ifdzabi0YlL/ixiJzJ58rinFgG3dqDOew1/rNs43SAdSB+Llp9Ko6W MX3C9i5CL1T1d8lc3HB6T+QO3GGXcAYXw0tQlvIeaZ1Xydfzt+CQsXyw6bW9m0ddZnATNR Wvy/a47MGMh97MeU2D0J0UXc+MS2tb8pDj+A/gwy6vdIJcT5oEYHM2700IFtGicuMucCno e9M/qOSujCE1oPs3GCQ5lIrp7lPx1zOeNjY7e6UfLdTjrG72FsenEzdZTgUYMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645980456; a=rsa-sha256; cv=none; b=Q30Ijvph8eaKrpVvC/L+xeR5tV46aV1aWB5dOB9BawbI/QQwZGJzvAzhb3h9+6rZmdgUui 3SXxS5gg5e43vgyqvsYIJTP8naZlc4Vk4GyhzzlSKEMaLSjB6knavTIBXip08r+z75sK3K UGkL2mLSlVcQXiIlh67wKqmiLusWh8xttzdBcPSHcyD/VQaAuTdQylhC6j1z4d0zO0+k3b iOOBX/gzUtQJxopjb46M6NwWhabchW5+h+1ny4UTQ7g4UGimdDhJKxRmPMHqd6YIP2HDKe c9LylFlgkmVwoxzTsFm/J08Wt1oWT7PvNS//6kOKhywMP+qVccD0e6Nhkmp/Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b782b7884c8aa19cb2dcb6ece6909e9f05173d72 commit b782b7884c8aa19cb2dcb6ece6909e9f05173d72 Author: Jose Luis Duran AuthorDate: 2022-02-25 14:39:12 +0000 Commit: Warner Losh CommitDate: 2022-02-27 16:11:59 +0000 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 --- lib/libefivar/efivar-dp-parse.c | 1 - 1 file changed, 1 deletion(-) 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);