From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1px54S-0005Qu-9Z for mharc-grub-devel@gnu.org; Thu, 11 May 2023 08:06:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1px54O-0005QQ-Be for grub-devel@gnu.org; Thu, 11 May 2023 08:06:52 -0400 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1px54L-0002SF-Pe for grub-devel@gnu.org; Thu, 11 May 2023 08:06:52 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EB4FF64C5F; Thu, 11 May 2023 12:06:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D378C433D2; Thu, 11 May 2023 12:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683806808; bh=6NMyCHGw/Ht9vQcvBqMl2EJRgcyj438TgYdc4cxT1AE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d43TppxNbLic+BhwWkDfIzZxmy9bQmIDl4gPrI8kLsi92F7kxkKeDUq5aHqrzqZuM wj4Rw0H6biWLc1ecLiUgdVbqyTl/gEW4yNqI0QniI94gYymxEuRKAAOxZ4fJI8yeqT 3GENi65+kZP2IRzn98BBrQ/0YjnggYLdIzh82QmKR96FCN4DqBYA+Sc3wkzsxVI3Ei vsw3CoLopMUlg8uf94PisZO0K9DDyRCFv+Klnbdm2pd12Au5wanDJ+fG/aaSQj/CCT 4BW7LTcg9R7waWOe6nvzVMT5XqOJr6D0XRd5pQmT7mhaUJpZzO7QBpJIUYHObWl77Z TUtg1O2cnFSog== From: Ard Biesheuvel To: grub-devel@gnu.org Cc: dkiper@net-space.pl, Ard Biesheuvel Subject: [PATCH v2 2/6] efi: Make EFI PXE protocol methods non-callable Date: Thu, 11 May 2023 14:06:36 +0200 Message-Id: <20230511120640.3518732-3-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230511120640.3518732-1-ardb@kernel.org> References: <20230511120640.3518732-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1404; i=ardb@kernel.org; h=from:subject; bh=6NMyCHGw/Ht9vQcvBqMl2EJRgcyj438TgYdc4cxT1AE=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JISXmllfZV5ucb0ZP7bbFZByYVp+/7mFe1SJjtvVWD3LeT /Vqea/ZUcrCIMbBICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACaiWsXwmy1grpy/9F2ZSfXn 1avqW3553mddXds/Ya8N99KSeYEXExkZ3v+126PH/HKxcuHH03oP9s6c90QnobogPMNnx7mqonP +vAA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=139.178.84.217; envelope-from=ardb@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2023 12:06:52 -0000 The grub_efi_pxe_t struct definition has placeholders for the various protocol method pointers, given that they are never called in the code, and the prototypes have been omitted, and therefore do not comply with the UEFI spec. So let's convert them into void* pointers, so they cannot be called inadvertently. Signed-off-by: Ard Biesheuvel --- include/grub/efi/api.h | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index b4c4646651cd53f5..da1a80ca3a94fe1c 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -1539,18 +1539,18 @@ typedef struct grub_efi_pxe_mode typedef struct grub_efi_pxe { grub_uint64_t rev; - void (*start) (void); - void (*stop) (void); - void (*dhcp) (void); - void (*discover) (void); - void (*mftp) (void); - void (*udpwrite) (void); - void (*udpread) (void); - void (*setipfilter) (void); - void (*arp) (void); - void (*setparams) (void); - void (*setstationip) (void); - void (*setpackets) (void); + void *start; + void *stop; + void *dhcp; + void *discover; + void *mftp; + void *udpwrite; + void *udpread; + void *setipfilter; + void *arp; + void *setparams; + void *setstationip; + void *setpackets; struct grub_efi_pxe_mode *mode; } grub_efi_pxe_t; -- 2.39.2