From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1q1Tzq-0007p4-L2 for mharc-grub-devel@gnu.org; Tue, 23 May 2023 11:32:24 -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 1q1TzT-0007al-CS for grub-devel@gnu.org; Tue, 23 May 2023 11:32:01 -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 1q1TzR-0002PX-0M for grub-devel@gnu.org; Tue, 23 May 2023 11:31:59 -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 005EC633CE; Tue, 23 May 2023 15:31:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFEC7C433EF; Tue, 23 May 2023 15:31:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684855914; bh=My4FtNd2K2h9VpihbWOvRg8WfMWZ/MgyxTIC2NPmxj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9WyPRsBjq9IYIJsCRkeI3Um9nQTz4SMb3ul5mwcLFYYIdHwr2nLkPayKZhdrYxkK mQy1tJQCNVDfz+gi1hnlBIYgs9sUvqe4ZsVcXsuVcV7Oq3CWOlv0Seo3hzYodR470p WndMOCc8xAHPKRljMuDD1WoiZbxiUDNbZm8mNayTgAfLOT+/DIHF/tI+COV+AKJx6X Hw1V4QK9+qUBlVkKDLHfh4TfXNbTHd4EeER+200Gx5ETk4wW+1vlHPa566C6YGqDes yMW/RV4VlhyirrlMQnRe69MCU9vwJAxIilgq1180Bj1UKPUQiFPEDqFOHPzmI40US0 gXLBFku5mplNQ== From: Ard Biesheuvel To: grub-devel@gnu.org Cc: Ard Biesheuvel , Daniel Kiper , Glenn Washburn Subject: [PATCH v4 1/5] efi: Make EFI PXE protocol methods non-callable Date: Tue, 23 May 2023 17:31:41 +0200 Message-Id: <20230523153145.822782-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230523153145.822782-1-ardb@kernel.org> References: <20230523153145.822782-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=owGbwMvMwCFmkMcZplerG8N4Wi2JISXnTnSH4kz188xfz7sWhW694izoLlg256Qpc4ZuxCoZ0 cIrX0Q7SlkYxDgYZMUUWQRm/3238/REqVrnWbIwc1iZQIYwcHEKwERmtTH8L7jWuUdys9f9nlus 4WqS7LPbvwdmOn60fPvu13b7zKXyJxgZNk840eyhveZVw46zTrnO2l2P7e18ClQ3t4Q12m5XOjS FBQA= 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: Tue, 23 May 2023 15:32:02 -0000 X-List-Received-Date: Tue, 23 May 2023 15:32:02 -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