2018-07-12 14:56:34 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2017-08-03 17:33:01 +00:00
|
|
|
From: Rob Clark <rclark@redhat.com>
|
2017-08-16 15:14:30 +00:00
|
|
|
Date: Wed, 19 Jul 2017 15:47:41 -0400
|
2018-07-10 18:39:10 +00:00
|
|
|
Subject: [PATCH] Fix a segfault in lsefi
|
2017-08-03 17:33:01 +00:00
|
|
|
|
|
|
|
when protocols_per_handle returns error, we can't use the pointers we
|
|
|
|
passed to it, and that includes trusting num_protocols.
|
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
2017-08-16 15:14:30 +00:00
|
|
|
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
2017-08-03 17:33:01 +00:00
|
|
|
---
|
2017-08-16 15:14:30 +00:00
|
|
|
grub-core/commands/efi/lsefi.c | 4 +++-
|
|
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
2017-08-03 17:33:01 +00:00
|
|
|
|
|
|
|
diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c
|
2018-02-27 18:56:41 +00:00
|
|
|
index d901c389263..d1ce99af438 100644
|
2017-08-03 17:33:01 +00:00
|
|
|
--- a/grub-core/commands/efi/lsefi.c
|
|
|
|
+++ b/grub-core/commands/efi/lsefi.c
|
2017-08-16 15:14:30 +00:00
|
|
|
@@ -109,8 +109,10 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),
|
|
|
|
|
2017-08-03 17:33:01 +00:00
|
|
|
status = efi_call_3 (grub_efi_system_table->boot_services->protocols_per_handle,
|
|
|
|
handle, &protocols, &num_protocols);
|
2017-08-16 15:14:30 +00:00
|
|
|
- if (status != GRUB_EFI_SUCCESS)
|
|
|
|
+ if (status != GRUB_EFI_SUCCESS) {
|
|
|
|
grub_printf ("Unable to retrieve protocols\n");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
2017-08-03 17:33:01 +00:00
|
|
|
for (j = 0; j < num_protocols; j++)
|
|
|
|
{
|
|
|
|
for (k = 0; k < ARRAY_SIZE (known_protocols); k++)
|