From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pwQbE-0000ar-7J for mharc-grub-devel@gnu.org; Tue, 09 May 2023 12:54:04 -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 1pwQbD-0000aN-DB for grub-devel@gnu.org; Tue, 09 May 2023 12:54:03 -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 1pwQbA-0003XP-Tx for grub-devel@gnu.org; Tue, 09 May 2023 12:54:03 -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 D56116297A; Tue, 9 May 2023 16:53:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B332C433EF; Tue, 9 May 2023 16:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683651232; bh=6NMyCHGw/Ht9vQcvBqMl2EJRgcyj438TgYdc4cxT1AE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tvdFboXF7mKKv5sdG/LJM6WOOpZTWA8DCg6235B0bwdYaMeQ2KLYMLL4AEIzC3OYW ptBif6371hDhPjSGowCi9MAOQSJ+cREZkCUZZbGpVJdjQ9DnyaDCrx4nMaoZj6UFwq JoQrpnQDugStMV9wQSt8ColUXcpZ8YnstkfOIIfhyCNuNgVc6h/dQV/EDNI9Y7qrPL SPIW3uQTCaTsT5lwYkzCmWTmgf2Itkflci2HygUNojfVVYm0+5UP67cVvjtxMmJrH9 W7CB8hvFRfa21irTXPiyM0kAqO1UZeI1f71HVtIF3XSY+ocl5iFNsdgZANPsuZK+KT 1mfCj5xOWWbrQ== From: Ard Biesheuvel To: grub-devel@gnu.org Cc: dkiper@net-space.pl, Ard Biesheuvel Subject: [PATCH 1/5] efi: Make EFI PXE protocol methods non-callable Date: Tue, 9 May 2023 18:53:37 +0200 Message-Id: <20230509165341.1609558-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230509165341.1609558-1-ardb@kernel.org> References: <20230509165341.1609558-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=owGbwMvMwCFmkMcZplerG8N4Wi2JISWqqr/sq03ON6OndttiMg5Mq89f9zCvapEx23qrBznvp 3q1vNfsKGVhEONgkBVTZBGY/ffdztMTpWqdZ8nCzGFlAhnCwMUpABN578Xwv5Sxa+7dEBWZ5CBd 5aa/fq4eCypnr6tSu/fk9J9MJ/bOewx/pZrFTYXnN+QmxlS+Ytk40TpxeoHTXba+FaLR2npbOb5 xAQA= 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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, 09 May 2023 16:54:03 -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