From nobody Mon Feb 9 11:06:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47397+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47397+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568749807; cv=none; d=zoho.com; s=zohoarc; b=S69jlq4MToCU9HdOVW8C7QohdapvFt3stV8GKoUXCTEIN3yd8XAzjxPcbtKVqa9+gNJmwZTs34c49IWjj7IbLYlsFHg4VAg6WD4ITgSZoyNunDUy7Xc5XaHacfeWjnYWBu7zNEmdyiJG9q5LIV8bzdq688KYmJNL355dMCj5uvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568749807; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=f4uOU77AhCBTmdGqZpgz+TjiJ4h7pjiBmHcxuwYhufQ=; b=mg8EZANThAKsGZNE+Vqu6+r6vi+TiMaRuoVMmOL9WsJV6mIRMEwKow7zEvRIlDjdRZnLQZhnGbjZXZ1lpToZqQ4QmxygqBWqbxeir9o/0JOhrue1KrDb7U1CO42mxwk/UyHQkbFJiVVBWculkPlDqMNLaucsFj7cZYrBHknkmtc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47397+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1568749807428350.0746216511427; Tue, 17 Sep 2019 12:50:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id A2ncYY1788612xkGr3mFri83; Tue, 17 Sep 2019 12:50:06 -0700 X-Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 17 Sep 2019 12:50:06 -0700 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A3D5718CB8EB; Tue, 17 Sep 2019 19:50:05 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-37.rdu2.redhat.com [10.10.120.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 603B8600C8; Tue, 17 Sep 2019 19:50:04 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Hao A Wu , Jian J Wang , Liming Gao Subject: [edk2-devel] [PATCH 10/35] MdeModulePkg/PlatformVarCleanupLib: fix HiiConstructConfigHdr() call Date: Tue, 17 Sep 2019 21:49:10 +0200 Message-Id: <20190917194935.24322-11-lersek@redhat.com> In-Reply-To: <20190917194935.24322-1-lersek@redhat.com> References: <20190917194935.24322-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Tue, 17 Sep 2019 19:50:05 +0000 (UTC) Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com X-Gm-Message-State: SKtaDYBOOFHpiaOdvOqpm64px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1568749806; bh=e+OpXegeKLLFL6tkXXJ9A9lgC+Q3Cs5CzxtDbFuF9Vw=; h=Cc:Date:From:Reply-To:Subject:To; b=n0OUT9og65Uuifuew8v1BUkJ2BATq+/oovKbD39Tho2sRu9P8GGH1440eg1AZ4h+57K Lucfyo+IT95MAqiBT20w3yXIuZ2rW0PIxlIvvr38R94a9O3O+zqKJPLQ2PmUqmS2lowDO z541ZiAfYkZc2QMUoNHunLNHcSEYuSZ47zA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The HiiConstructConfigHdr() function takes the "DriverHandle" parameter in order to fetch the device path from it, and then turn the device path into PATH routing information. The HiiConstructConfigHdr() function is called from VariableCleanupHiiExtractConfig(), which is only installed when "Type" is "VarCleanupManually" in PlatformVarCleanup(). In that case, we create "Private->DriverHandle" as a new handle, and install "mVarCleanupHiiVendorDevicePath" on it. Then we pass "Private->DriverHandle" to HiiAddPackages(), which consumes the device path for routing purposes. It follows that the "DriverHandle" argument pased to HiiConstructConfigHdr() should be the same driver handle, for matching routing. Currently we pass "Private->HiiHandle", which is clearly a typo, because it is the return value of HiiAddPackages(), and stands for the published HII package list. Therefore this patch addresses an actual bug. The typo has not been flagged by compilers because the UEFI spec regrettably defines both EFI_HANDLE and EFI_HII_HANDLE as (VOID*). Cc: Hao A Wu Cc: Jian J Wang Cc: Liming Gao Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- Notes: build-tested only MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c= b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c index 968c044a316a..3875d614bb41 100644 --- a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c +++ b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c @@ -609,7 +609,11 @@ VariableCleanupHiiExtractConfig ( // Allocate and fill a buffer large enough to hold the tem= plate // followed by "&OFFSET=3D0&WIDTH=3DWWWWWWWWWWWWWWWW" followed by a Nu= ll-terminator. // - ConfigRequestHdr =3D HiiConstructConfigHdr (&mVariableCleanupHiiGuid, = mVarStoreName, Private->HiiHandle); + ConfigRequestHdr =3D HiiConstructConfigHdr ( + &mVariableCleanupHiiGuid, + mVarStoreName, + Private->DriverHandle + ); Size =3D (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); ConfigRequest =3D AllocateZeroPool (Size); ASSERT (ConfigRequest !=3D NULL); --=20 2.19.1.3.g30247aa5d201 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47397): https://edk2.groups.io/g/devel/message/47397 Mute This Topic: https://groups.io/mt/34180211/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-