Skip to contentSkip to conversation

ieee1275: Fix crash in of_path_of_nvme when of_path is empty

PATCH Superseded John Paul Adrian Glaubitz 2 participants 4 messages Mar 1, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ieee1275: Fix crash in of_path_of_nvme when of_path is empty

We have recently backported the upstream changes to Debian's grub2 package to support modern SPARC hardware for Debian's sparc64 port.

One of the changes introduced a regression on systems with NVME devices but not

The of_path_of_nvme function (commit 2391d57, ieee1275: add nvme support within ofpath) introduced a functional regression:

On systems where of_path is empty, i.e. non-OpenFirmware machines, grub-probe crashes in of_path_of_nvme when trying to append the disk name to an empty of_path.

#1 lore raw

PATCH 1/1 ieee1275: Fix crash in of_path_of_nvme when of_path is empty

The of_path_of_nvme function (commit 2391d57, ieee1275: add nvme support within ofpath) introduced a functional regression:

On systems where of_path is empty, i.e. non-OpenFirmware machines, grub-probe crashes in of_path_of_nvme when trying to append the disk name to an empty of_path.

---
 grub-core/osdep/linux/ofpath.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
grub-core/osdep/linux/ofpath.c +6 -1
index 1c30e7233..da0000f0f 100644
@@ -389,8 +389,13 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)),
     }
 
   of_path = find_obppath (sysfs_path);
+
+  if(of_path)
+    strcat (of_path, disk);
+  else
+    of_path = strdup(disk);
+
   free (sysfs_path);
-  strcat (of_path, disk);
   return of_path;
 }
 
Signature · 1 line
2.16.2
#2 lore raw
In reply to John Paul Adrian Glaubitz
Quoted 5 lines · John Paul Adrian Glaubitz

We have recently backported the upstream changes to Debian's grub2 package to support modern SPARC hardware for Debian's sparc64 port.

One of the changes introduced a regression on systems with NVME devices but not

Sorry, that message was accidentally sent incompletely. I will re-send the patch with a proper message. Please don't merge.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#3 lore raw

Bug#891773: Info received ([PATCH] ieee1275: Fix crash in of_path_of_nvme when of_path is empty)

Thank you for the additional information you have supplied regarding this Bug report.

This is an automatically generated reply to let you know your message has been received.

Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
GRUB Maintainers <[email protected]>

If you wish to submit further information on this problem, please send it to [email protected].

Please do not send mail to [email protected] unless you wish to report a problem with the Bug-tracking system.

Signature · 3 lines
891773: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891773
Debian Bug Tracking System
Contact [email protected] with problems