From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1q1NJV-0005Vu-Rj for mharc-grub-devel@gnu.org; Tue, 23 May 2023 04:24:13 -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 1q1NJT-0005Uy-ON for grub-devel@gnu.org; Tue, 23 May 2023 04:24:11 -0400 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1NJR-0006JF-OO for grub-devel@gnu.org; Tue, 23 May 2023 04:24:11 -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 853A2630AD; Tue, 23 May 2023 08:24:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFB24C433D2; Tue, 23 May 2023 08:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684830242; bh=My4FtNd2K2h9VpihbWOvRg8WfMWZ/MgyxTIC2NPmxj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d6eK2TDiEGU1C6gcw5x/ppq1rwCqGwUWAJbq2Jjmqsvo4twWJvw7bH1w8n517GeRj P1DHeILxyeH3j3Ei4RYQodqQwRztv1+jGrjaFZ/iwMGZn2jxUvb6GGKguo2O+B5ekq ZItPtiEF/OzMN5zRVmFWGSHYlyaPnNcfn/B6oV1sibqehtB19Gnr0P81WX44RxdxBm gZTzrN7bbuQ7X67q68vk/K4/dVid/FiU5TfuFPlDEQcHJtTS/HtyogLJRBw4LK845b vC05iBBy4lQdG8CYzTu9RRtnsE9yalz+hfhLeSD6iuDhKrpnvP1LLAQUnwpPJyIxw/ 62JURFMAuOw5Q== From: Ard Biesheuvel To: grub-devel@gnu.org Cc: Ard Biesheuvel , Daniel Kiper , Glenn Washburn Subject: [PATCH v3 1/5] efi: Make EFI PXE protocol methods non-callable Date: Tue, 23 May 2023 10:23:51 +0200 Message-Id: <20230523082355.690271-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230523082355.690271-1-ardb@kernel.org> References: <20230523082355.690271-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=My4FtNd2K2h9VpihbWOvRg8WfMWZ/MgyxTIC2NPmxj8=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JISWnQrRDcab6eeav512LQrdecRZ0Fyybc9KUOUM3YpWMa OGVL6IdpSwMYhwMsmKKLAKz/77beXqiVK3zLFmYOaxMIEMYuDgFYCKqxowMH6K0y345l4d5MX5J sbuwb0/MXE2JLGfnVz+rbSQmWc+wZ2S4ss/qR0mjl0LT3weTtqSWsk/tKtnOekXv3trXxjwKe1R 4AQ== X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2604:1380:4641:c500::1; 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: Tue, 23 May 2023 08:24:11 -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 4ae5e51c9013ceb3..7077d2265df9b20a 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