All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix a segfault in lsefi
@ 2017-07-19 19:47 Peter Jones
  2017-07-27 13:44 ` Daniel Kiper
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Jones @ 2017-07-19 19:47 UTC (permalink / raw)
  To: grub-devel; +Cc: Rob Clark, Peter Jones

From: Rob Clark <rclark@redhat.com>

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>
---
 grub-core/commands/efi/lsefi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c
index d901c3892..d1ce99af4 100644
--- a/grub-core/commands/efi/lsefi.c
+++ b/grub-core/commands/efi/lsefi.c
@@ -109,8 +109,10 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),
 
       status = efi_call_3 (grub_efi_system_table->boot_services->protocols_per_handle,
 			   handle, &protocols, &num_protocols);
-      if (status != GRUB_EFI_SUCCESS)
+      if (status != GRUB_EFI_SUCCESS) {
 	grub_printf ("Unable to retrieve protocols\n");
+	continue;
+      }
       for (j = 0; j < num_protocols; j++)
 	{
 	  for (k = 0; k < ARRAY_SIZE (known_protocols); k++)
-- 
2.13.3



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

* Re: [PATCH] Fix a segfault in lsefi
  2017-07-19 19:47 [PATCH] Fix a segfault in lsefi Peter Jones
@ 2017-07-27 13:44 ` Daniel Kiper
  2017-08-03 18:07   ` Daniel Kiper
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Kiper @ 2017-07-27 13:44 UTC (permalink / raw)
  To: grub-devel, pjones; +Cc: Rob Clark

On Wed, Jul 19, 2017 at 03:47:41PM -0400, Peter Jones wrote:
> From: Rob Clark <rclark@redhat.com>
>
> 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>

LGTM, if there are no objections I will apply it next week.

Daniel


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

* Re: [PATCH] Fix a segfault in lsefi
  2017-07-27 13:44 ` Daniel Kiper
@ 2017-08-03 18:07   ` Daniel Kiper
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2017-08-03 18:07 UTC (permalink / raw)
  To: pjones; +Cc: grub-devel, dkiper, Rob Clark

On Thu, Jul 27, 2017 at 03:44:08PM +0200, Daniel Kiper wrote:
> On Wed, Jul 19, 2017 at 03:47:41PM -0400, Peter Jones wrote:
> > From: Rob Clark <rclark@redhat.com>
> >
> > 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>
>
> LGTM, if there are no objections I will apply it next week.

Applied.

Daniel


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

end of thread, other threads:[~2017-08-03 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19 19:47 [PATCH] Fix a segfault in lsefi Peter Jones
2017-07-27 13:44 ` Daniel Kiper
2017-08-03 18:07   ` Daniel Kiper

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.