All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ieee1275: NULL pointer dereference in grub_machine_get_bootlocation
@ 2018-03-14 15:51 Eric Snowberg
  2018-03-22 12:34 ` Daniel Kiper
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Snowberg @ 2018-03-14 15:51 UTC (permalink / raw)
  To: grub-devel; +Cc: daniel.kiper, eric.snowberg

Read from NULL pointer canon in function grub_machine_get_bootlocation.
Function grub_ieee1275_canonicalise_devname may return NULL.

Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
---
 grub-core/kern/ieee1275/init.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index 62dfb8a..0d8ebf5 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -110,6 +110,8 @@ grub_machine_get_bootlocation (char **device, char **path)
       char *ptr;
       dev = grub_ieee1275_get_aliasdevname (bootpath);
       canon = grub_ieee1275_canonicalise_devname (dev);
+      if (! canon)
+        return;
       ptr = canon + grub_strlen (canon) - 1;
       while (ptr > canon && (*ptr == ',' || *ptr == ':'))
 	ptr--;
-- 
1.7.1



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

* Re: [PATCH] ieee1275: NULL pointer dereference in grub_machine_get_bootlocation
  2018-03-14 15:51 [PATCH] ieee1275: NULL pointer dereference in grub_machine_get_bootlocation Eric Snowberg
@ 2018-03-22 12:34 ` Daniel Kiper
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Kiper @ 2018-03-22 12:34 UTC (permalink / raw)
  To: Eric Snowberg; +Cc: grub-devel

On Wed, Mar 14, 2018 at 08:51:17AM -0700, Eric Snowberg wrote:
> Read from NULL pointer canon in function grub_machine_get_bootlocation.
> Function grub_ieee1275_canonicalise_devname may return NULL.
>
> Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


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

end of thread, other threads:[~2018-03-22 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 15:51 [PATCH] ieee1275: NULL pointer dereference in grub_machine_get_bootlocation Eric Snowberg
2018-03-22 12:34 ` 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.