linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] efi/arm64: fix potential NULL dereference of efi.systab
@ 2014-07-02 10:10 Ard Biesheuvel
  2014-07-02 10:10 ` [PATCH 2/2] efi: implement mandatory locking for UEFI Runtime Services Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Ard Biesheuvel @ 2014-07-02 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

We assign efi.systab using efi_lookup_mapped_addr(), and test for !NULL, but
then go on an dereference it anyway.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/kernel/efi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index 56c3327bbf79..e785f93f17cb 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -419,8 +419,11 @@ static int __init arm64_enter_virtual_mode(void)
 	}
 
 	efi.systab = (__force void *)efi_lookup_mapped_addr(efi_system_table);
-	if (efi.systab)
-		set_bit(EFI_SYSTEM_TABLES, &efi.flags);
+	if (!efi.systab) {
+		pr_err("Failed to remap EFI System Table!\n");
+		return -1;
+	}
+	set_bit(EFI_SYSTEM_TABLES, &efi.flags);
 
 	local_irq_save(flags);
 	cpu_switch_mm(idmap_pg_dir, &init_mm);
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-07-08  9:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02 10:10 [PATCH 1/2] efi/arm64: fix potential NULL dereference of efi.systab Ard Biesheuvel
2014-07-02 10:10 ` [PATCH 2/2] efi: implement mandatory locking for UEFI Runtime Services Ard Biesheuvel
2014-07-07 20:29   ` Matt Fleming
2014-07-07 20:43     ` Ard Biesheuvel
2014-07-08  8:54       ` Ard Biesheuvel
2014-07-08  9:29         ` Matt Fleming
2014-07-08  9:45           ` Ard Biesheuvel
2014-07-08  9:52             ` Matt Fleming
2014-07-02 10:13 ` [PATCH 1/2] efi/arm64: fix potential NULL dereference of efi.systab Ard Biesheuvel
2014-07-02 14:29   ` Mark Salter
2014-07-03 16:04     ` Ard Biesheuvel
2014-07-04 13:38 ` Catalin Marinas
2014-07-04 13:54   ` Ard Biesheuvel
2014-07-04 15:32     ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).