All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] efi/arm64: fix potential NULL dereference of efi.systab
@ 2014-07-02 10:10 ` Ard Biesheuvel
  0 siblings, 0 replies; 28+ messages in thread
From: Ard Biesheuvel @ 2014-07-02 10:10 UTC (permalink / raw)
  To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, x86-DgEjT+Ai2ygdnm+yROfE0A
  Cc: catalin.marinas-5wv7dgnIgG8, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	hpa-YMNOUZJC4hwAvxtiuMwx3w, leif.lindholm-QSEj5FYQhm4dnm+yROfE0A,
	roy.franz-QSEj5FYQhm4dnm+yROfE0A, msalter-H+wXaHxf7aLQT0dZR+AlfA,
	Ard Biesheuvel

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-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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] 28+ messages in thread

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

Thread overview: 28+ 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 ` Ard Biesheuvel
     [not found] ` <1404295802-28030-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-02 10:10   ` [PATCH 2/2] efi: implement mandatory locking for UEFI Runtime Services Ard Biesheuvel
2014-07-02 10:10     ` Ard Biesheuvel
     [not found]     ` <1404295802-28030-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-07 20:29       ` Matt Fleming
2014-07-07 20:29         ` Matt Fleming
     [not found]         ` <20140707202954.GC27474-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-07-07 20:43           ` Ard Biesheuvel
2014-07-07 20:43             ` Ard Biesheuvel
     [not found]             ` <CAKv+Gu91CQADTQ8KMjXQPwVDvW1XkUYO2E5=Mu=aAtrB8B3q_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-08  8:54               ` Ard Biesheuvel
2014-07-08  8:54                 ` Ard Biesheuvel
     [not found]                 ` <CAKv+Gu8LbfuuEYyhAeu3dUiKHqzN_UFMbOjY0agVihbmmVL9CA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-08  9:29                   ` Matt Fleming
2014-07-08  9:29                     ` Matt Fleming
     [not found]                     ` <20140708092958.GD27474-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-07-08  9:45                       ` Ard Biesheuvel
2014-07-08  9:45                         ` Ard Biesheuvel
     [not found]                         ` <CAKv+Gu9HkJgsnzUAROVwPKaHGHRU9FwAp+eOT8N8kYDR3Dda+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-08  9:52                           ` Matt Fleming
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 10:13     ` Ard Biesheuvel
     [not found]     ` <CAKv+Gu-SLQC82q7Rj5ZusbFxwysy7KpRhZ=vw1ipXu9kvq46aQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-02 14:29       ` Mark Salter
2014-07-02 14:29         ` Mark Salter
     [not found]         ` <1404311385.19665.15.camel-PDpCo7skNiwAicBL8TP8PQ@public.gmane.org>
2014-07-03 16:04           ` Ard Biesheuvel
2014-07-03 16:04             ` Ard Biesheuvel
2014-07-04 13:38   ` Catalin Marinas
2014-07-04 13:38     ` Catalin Marinas
     [not found]     ` <20140704133844.GG16404-5wv7dgnIgG8@public.gmane.org>
2014-07-04 13:54       ` Ard Biesheuvel
2014-07-04 13:54         ` Ard Biesheuvel
     [not found]         ` <CAKv+Gu_VJZuzio8oyDA4OKwaeZj3J4WY_kX4s-_zhs1rk35b7A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-04 15:32           ` Catalin Marinas
2014-07-04 15:32             ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.