dmidecode-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dmidecode] [PATCH] dmidecode: Only scan /dev/mem for entry point on x86


From: Jean Delvare
Subject: [dmidecode] [PATCH] dmidecode: Only scan /dev/mem for entry point on x86
Date: Wed, 26 Jun 2019 12:55:59 +0200

x86 is the only architecture which can have a DMI entry point scanned
from /dev/mem. Do not attempt it on other architectures, because not
only it can't work, but it can even cause the system to reboot.

This should fix support request #109697:
https://savannah.nongnu.org/support/?109697
---
 dmidecode.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- dmidecode.orig/dmidecode.c  2019-04-19 10:01:22.394992483 +0200
+++ dmidecode/dmidecode.c       2019-06-26 11:20:28.965060297 +0200
@@ -2,7 +2,7 @@
  * DMI Decode
  *
  *   Copyright (C) 2000-2002 Alan Cox <address@hidden>
- *   Copyright (C) 2002-2018 Jean Delvare <address@hidden>
+ *   Copyright (C) 2002-2019 Jean Delvare <address@hidden>
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -5538,7 +5538,7 @@ int main(int argc, char * const argv[])
        off_t fp;
        size_t size;
        int efi;
-       u8 *buf;
+       u8 *buf = NULL;
 
        /*
         * We don't want stdout and stderr to be mixed up if both are
@@ -5642,7 +5642,7 @@ int main(int argc, char * const argv[])
                        printf("Failed to get SMBIOS data from sysfs.\n");
        }
 
-       /* Next try EFI (ia64, Intel-based Mac) */
+       /* Next try EFI (ia64, Intel-based Mac, arm64) */
        efi = address_from_efi(&fp);
        switch (efi)
        {
@@ -5675,6 +5675,7 @@ int main(int argc, char * const argv[])
        goto done;
 
 memory_scan:
+#if defined __i386__ || defined __x86_64__
        if (!(opt.flags & FLAG_QUIET))
                printf("Scanning %s for entry point.\n", opt.devmem);
        /* Fallback to memory scan (x86, x86_64) */
@@ -5717,6 +5718,7 @@ int main(int argc, char * const argv[])
                        }
                }
        }
+#endif
 
 done:
        if (!found && !(opt.flags & FLAG_QUIET))


-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]