From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 17 Sep 2019 12:50:29 -0700 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 2AAD083F40; Tue, 17 Sep 2019 19:50:29 +0000 (UTC) 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 20E25600C4; Tue, 17 Sep 2019 19:50:27 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Jordan Justen Subject: [PATCH 24/35] OvmfPkg/PlatformDxe: fix EFI_HII_HANDLE parameters of internal functions Date: Tue, 17 Sep 2019 21:49:24 +0200 Message-Id: <20190917194935.24322-25-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.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 17 Sep 2019 19:50:29 +0000 (UTC) Content-Transfer-Encoding: quoted-printable In the following call tree: PlatformInit () mInstalledPackages =3D HiiAddPackages () GopInstalled () PopulateForm (PackageList =3D mInstalledPackages) CreateResolutionOptions (PackageList) HiiSetString (PackageList HiiUpdateForm (PackageList) PlatformDxe passes around an EFI_HII_HANDLE that (a) originates from HiiAddPackages() and (b) is ultimately passed to HiiSetString() and HiiUpdateForm(). The intermediate functions PopulateForm() and CreateResolutionOptions() however take that parameter as an (EFI_HII_HANDLE*). There is no bug in practice (because the affected functions never try to de-reference the "PackageList" parameter, they just pass it on), but the function prototypes are semantically wrong. Fix that. This could remain hidden so long because pointer-to-VOID silently convert= s to/from any pointer-to-object type, and the UEFI spec mandates that EFI_HII_HANDLE be a typedef to (VOID*). Cc: Ard Biesheuvel Cc: Jordan Justen Signed-off-by: Laszlo Ersek --- Notes: tested in UiApp OvmfPkg/PlatformDxe/Platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platfor= m.c index 09181769babf..23ad43901f66 100644 --- a/OvmfPkg/PlatformDxe/Platform.c +++ b/OvmfPkg/PlatformDxe/Platform.c @@ -486,7 +486,7 @@ STATIC EFI_STATUS EFIAPI CreateResolutionOptions ( - IN EFI_HII_HANDLE *PackageList, + IN EFI_HII_HANDLE PackageList, OUT VOID **OpCodeBuffer, IN UINTN NumGopModes, IN GOP_MODE *GopModes @@ -547,7 +547,7 @@ STATIC EFI_STATUS EFIAPI PopulateForm ( - IN EFI_HII_HANDLE *PackageList, + IN EFI_HII_HANDLE PackageList, IN EFI_GUID *FormSetGuid, IN EFI_FORM_ID FormId, IN UINTN NumGopModes, --=20 2.19.1.3.g30247aa5d201