From 4aebc28fb829a397e072da918c41c31d1e60a6991e45424e1f4adc6b6b592c46 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 24 May 2017 13:58:17 +0000 Subject: [PATCH] - Update to upstream version 3.1: * Support for SMBIOS 3.1.0 and 3.1.1. This includes new chassis types, new processor family names, new processor family upgrade names, and new slot types, as well as support of larger BIOS ROM sizes and cache sizes, and a new structure type (43, TPM Device.) * A new command line option to query OEM strings. * All error messages are now printed on stderr (#47274, #48158.) * Fixes a crash with SIGBUS (#46066.) * Various minor fixes, improvements and cleanups. * Obsoletes dmidecode-01-add-no-sysfs-option-description-to-h-output.patch, dmidecode-02-fix-no-smbios-nor-dmi-entry-point-found-on-smbios3.patch, dmidecode-03-let-read_file-return-the-actual-data-size.patch, dmidecode-04-use-read_file-to-read-the-dmi-table-from-sysfs.patch, dmidecode-05-use-dword-for-structure-table-maximum-size-in-smbios3.patch, dmidecode-06-hide-irrelevant-fixup-message.patch, and dmidecode-07-only-decode-one-dmi-table.patch. OBS-URL: https://build.opensuse.org/package/show/Base:System/dmidecode?expand=0&rev=38 --- ...sysfs-option-description-to-h-output.patch | 22 ----- ...nor-dmi-entry-point-found-on-smbios3.patch | 44 --------- ...ead_file-return-the-actual-data-size.patch | 90 ------------------ ...ile-to-read-the-dmi-table-from-sysfs.patch | 67 ------------- ...ucture-table-maximum-size-in-smbios3.patch | 29 ------ ...ode-06-hide-irrelevant-fixup-message.patch | 49 ---------- dmidecode-07-only-decode-one-dmi-table.patch | 68 ------------- dmidecode-3.0.tar.xz | 3 - dmidecode-3.0.tar.xz.sig | Bin 65 -> 0 bytes dmidecode-3.1.tar.xz | 3 + dmidecode-3.1.tar.xz.sig | Bin 0 -> 65 bytes dmidecode.changes | 21 ++++ dmidecode.spec | 18 +--- 13 files changed, 26 insertions(+), 388 deletions(-) delete mode 100644 dmidecode-01-add-no-sysfs-option-description-to-h-output.patch delete mode 100644 dmidecode-02-fix-no-smbios-nor-dmi-entry-point-found-on-smbios3.patch delete mode 100644 dmidecode-03-let-read_file-return-the-actual-data-size.patch delete mode 100644 dmidecode-04-use-read_file-to-read-the-dmi-table-from-sysfs.patch delete mode 100644 dmidecode-05-use-dword-for-structure-table-maximum-size-in-smbios3.patch delete mode 100644 dmidecode-06-hide-irrelevant-fixup-message.patch delete mode 100644 dmidecode-07-only-decode-one-dmi-table.patch delete mode 100644 dmidecode-3.0.tar.xz delete mode 100644 dmidecode-3.0.tar.xz.sig create mode 100644 dmidecode-3.1.tar.xz create mode 100644 dmidecode-3.1.tar.xz.sig diff --git a/dmidecode-01-add-no-sysfs-option-description-to-h-output.patch b/dmidecode-01-add-no-sysfs-option-description-to-h-output.patch deleted file mode 100644 index 8f54639..0000000 --- a/dmidecode-01-add-no-sysfs-option-description-to-h-output.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Roy Franz -Date: Thu, 1 Oct 2015 08:41:43 +0200 -Subject: Add "--no-sysfs" option description to -h output -Git-commit: 33b5aafc6ee6b5de9f2526fb1cf4b14d1e16e4f0 - -A description of --no-sysfs was not added to the output of "-h" when -the feature was added, so add it now. - ---- - dmiopt.c | 1 + - 1 file changed, 1 insertion(+) - ---- dmidecode-3.0.orig/dmiopt.c 2016-05-03 16:05:03.135840902 +0200 -+++ dmidecode-3.0/dmiopt.c 2016-05-03 16:05:04.199850803 +0200 -@@ -314,6 +314,7 @@ void print_help(void) - " -u, --dump Do not decode the entries\n" - " --dump-bin FILE Dump the DMI data to a binary file\n" - " --from-dump FILE Read the DMI data from a binary file\n" -+ " --no-sysfs Do not attempt to read DMI data from sysfs files\n" - " -V, --version Display the version and exit\n"; - - printf("%s", help); diff --git a/dmidecode-02-fix-no-smbios-nor-dmi-entry-point-found-on-smbios3.patch b/dmidecode-02-fix-no-smbios-nor-dmi-entry-point-found-on-smbios3.patch deleted file mode 100644 index e343478..0000000 --- a/dmidecode-02-fix-no-smbios-nor-dmi-entry-point-found-on-smbios3.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Xie XiuQi -Date: Wed, 21 Oct 2015 15:12:50 +0200 -Subject: Fix 'No SMBIOS nor DMI entry point found' on SMBIOS3 -Git-commit: bf7bad24ce141dab5b5acc3ffb98ce5fe4a8e0f9 - -address_from_efi may return a SMBIOS or SMBIOS3 format entry -point, so add this condition. - ---- - AUTHORS | 1 + - dmidecode.c | 12 ++++++++++-- - 2 files changed, 11 insertions(+), 2 deletions(-) - ---- dmidecode-3.0.orig/AUTHORS 2016-05-03 16:05:03.118840743 +0200 -+++ dmidecode-3.0/AUTHORS 2016-05-03 16:05:07.803884342 +0200 -@@ -19,6 +19,7 @@ Jarod Wilson - Anton Arapov - Roy Franz - Tyler Bell -+Xie XiuQi - - MANY THANKS TO (IN CHRONOLOGICAL ORDER) - Werner Heuser ---- dmidecode-3.0.orig/dmidecode.c 2016-05-03 16:05:03.118840743 +0200 -+++ dmidecode-3.0/dmidecode.c 2016-05-03 16:05:07.804884352 +0200 -@@ -4864,8 +4864,16 @@ int main(int argc, char * const argv[]) - goto exit_free; - } - -- if (smbios_decode(buf, opt.devmem, 0)) -- found++; -+ if (memcmp(buf, "_SM3_", 5) == 0) -+ { -+ if (smbios3_decode(buf, opt.devmem, 0)) -+ found++; -+ } -+ else if (memcmp(buf, "_SM_", 4) == 0) -+ { -+ if (smbios_decode(buf, opt.devmem, 0)) -+ found++; -+ } - goto done; - - memory_scan: diff --git a/dmidecode-03-let-read_file-return-the-actual-data-size.patch b/dmidecode-03-let-read_file-return-the-actual-data-size.patch deleted file mode 100644 index a799c48..0000000 --- a/dmidecode-03-let-read_file-return-the-actual-data-size.patch +++ /dev/null @@ -1,90 +0,0 @@ -From: Jean Delvare -Date: Mon, 2 Nov 2015 09:45:26 +0100 -Subject: Let read_file return the actual data size -Git-commit: de9a74e1c60210bee229fcf55b1678a99d1b44dd - -Let read_file return the actual data size to the caller. This gives -the caller the possibility to check that the data size is as expected -and large enough for the purpose, and report to the user if not. - ---- - dmidecode.c | 4 +++- - util.c | 11 +++++++---- - util.h | 2 +- - 3 files changed, 11 insertions(+), 6 deletions(-) - ---- dmidecode-3.0.orig/dmidecode.c 2016-05-03 16:05:07.804884352 +0200 -+++ dmidecode-3.0/dmidecode.c 2016-05-03 16:05:09.139896776 +0200 -@@ -4748,6 +4748,7 @@ int main(int argc, char * const argv[]) - int ret = 0; /* Returned value */ - int found = 0; - off_t fp; -+ size_t size; - int efi; - u8 *buf; - -@@ -4817,8 +4818,9 @@ int main(int argc, char * const argv[]) - * contain one of several types of entry points, so read enough for - * the largest one, then determine what type it contains. - */ -+ size = 0x20; - if (!(opt.flags & FLAG_NO_SYSFS) -- && (buf = read_file(0x20, SYS_ENTRY_FILE)) != NULL) -+ && (buf = read_file(&size, SYS_ENTRY_FILE)) != NULL) - { - if (!(opt.flags & FLAG_QUIET)) - printf("Getting SMBIOS data from sysfs.\n"); ---- dmidecode-3.0.orig/util.c 2016-05-03 16:05:03.085840436 +0200 -+++ dmidecode-3.0/util.c 2016-05-03 16:05:09.139896776 +0200 -@@ -94,10 +94,11 @@ int checksum(const u8 *buf, size_t len) - * needs to be freed by the caller. - * This provides a similar usage model to mem_chunk() - * -- * Returns pointer to buffer of max_len bytes, or NULL on error -+ * Returns pointer to buffer of max_len bytes, or NULL on error, and -+ * sets max_len to the length actually read. - * - */ --void *read_file(size_t max_len, const char *filename) -+void *read_file(size_t *max_len, const char *filename) - { - int fd; - size_t r2 = 0; -@@ -115,7 +116,7 @@ void *read_file(size_t max_len, const ch - return(NULL); - } - -- if ((p = malloc(max_len)) == NULL) -+ if ((p = malloc(*max_len)) == NULL) - { - perror("malloc"); - return NULL; -@@ -123,7 +124,7 @@ void *read_file(size_t max_len, const ch - - do - { -- r = read(fd, p + r2, max_len - r2); -+ r = read(fd, p + r2, *max_len - r2); - if (r == -1) - { - if (errno != EINTR) -@@ -140,6 +141,8 @@ void *read_file(size_t max_len, const ch - while (r != 0); - - close(fd); -+ *max_len = r2; -+ - return p; - } - ---- dmidecode-3.0.orig/util.h 2016-05-03 16:05:03.085840436 +0200 -+++ dmidecode-3.0/util.h 2016-05-03 16:05:09.139896776 +0200 -@@ -25,7 +25,7 @@ - #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) - - int checksum(const u8 *buf, size_t len); --void *read_file(size_t len, const char *filename); -+void *read_file(size_t *len, const char *filename); - void *mem_chunk(off_t base, size_t len, const char *devmem); - int write_dump(size_t base, size_t len, const void *data, const char *dumpfile, int add); - u64 u64_range(u64 start, u64 end); diff --git a/dmidecode-04-use-read_file-to-read-the-dmi-table-from-sysfs.patch b/dmidecode-04-use-read_file-to-read-the-dmi-table-from-sysfs.patch deleted file mode 100644 index c2a4c16..0000000 --- a/dmidecode-04-use-read_file-to-read-the-dmi-table-from-sysfs.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Jean Delvare -Date: Mon, 2 Nov 2015 09:45:31 +0100 -Subject: dmidecode: Use read_file() to read the DMI table from sysfs -Git-commit: 364055211b1956539c6a6268e111e244e1292c8c -References: https://savannah.nongnu.org/bugs/?46176 - -We shouldn't use mem_chunk() to read the DMI table from sysfs. This -will fail for SMBIOS v3 implementations which specify a maximum length -for the table rather than its exact length. The kernel will trim the -table to the actual length, so the DMI file will be shorter than the -length announced in entry point. - -read_file() fits the bill in this case, as it deals with end of file -nicely. - -This also helps with corrupted DMI tables, as the kernel will not -export the part of the table that it wasn't able to parse, effectively -trimming it. - -This fixes bug #46176: -https://savannah.nongnu.org/bugs/?46176 -Unexpected end of file error - ---- - dmidecode.c | 29 +++++++++++++++++++++-------- - 1 file changed, 21 insertions(+), 8 deletions(-) - ---- dmidecode-3.0.orig/dmidecode.c 2016-05-03 16:05:09.139896776 +0200 -+++ dmidecode-3.0/dmidecode.c 2016-05-03 16:05:10.336907916 +0200 -@@ -4521,16 +4521,29 @@ static void dmi_table(off_t base, u32 le - printf("\n"); - } - -- /* -- * When we are reading the DMI table from sysfs, we want to print -- * the address of the table (done above), but the offset of the -- * data in the file is 0. When reading from /dev/mem, the offset -- * in the file is the address. -- */ - if (flags & FLAG_NO_FILE_OFFSET) -- base = 0; -+ { -+ /* -+ * When reading from sysfs, the file may be shorter than -+ * announced. For SMBIOS v3 this is expcted, as we only know -+ * the maximum table size, not the actual table size. For older -+ * implementations (and for SMBIOS v3 too), this would be the -+ * result of the kernel truncating the table on parse error. -+ */ -+ size_t size = len; -+ buf = read_file(&size, devmem); -+ if (!(opt.flags & FLAG_QUIET) && num && size != (size_t)len) -+ { -+ printf("Wrong DMI structures length: %u bytes " -+ "announced, only %lu bytes available.\n", -+ len, (unsigned long)size); -+ } -+ len = size; -+ } -+ else -+ buf = mem_chunk(base, len, devmem); - -- if ((buf = mem_chunk(base, len, devmem)) == NULL) -+ if (buf == NULL) - { - fprintf(stderr, "Table is unreachable, sorry." - #ifndef USE_MMAP diff --git a/dmidecode-05-use-dword-for-structure-table-maximum-size-in-smbios3.patch b/dmidecode-05-use-dword-for-structure-table-maximum-size-in-smbios3.patch deleted file mode 100644 index ad6bb6e..0000000 --- a/dmidecode-05-use-dword-for-structure-table-maximum-size-in-smbios3.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Xie XiuQi -Date: Mon, 1 Feb 2016 09:30:31 +0100 -Subject: Use DWORD for Structure table maximum size in SMBIOS3 -Git-commit: ab02b117511230e46bbef7febbd854b9c832c13c - -0Ch DWORD "Structure table maximum size" - -Maximum size of SMBIOS Structure Table, pointed to by -the Structure Table Address, in bytes. The actual size is -guaranteed to be less or equal to the maximum size. - -Signed-off-by: Xie XiuQi -Signed-off-by: Jean Delvare - ---- - dmidecode.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- dmidecode-3.0.orig/dmidecode.c 2016-05-03 16:05:10.336907916 +0200 -+++ dmidecode-3.0/dmidecode.c 2016-05-03 16:05:11.533919057 +0200 -@@ -4612,7 +4612,7 @@ static int smbios3_decode(u8 *buf, const - } - - dmi_table(((off_t)offset.h << 32) | offset.l, -- WORD(buf + 0x0C), 0, ver, devmem, flags | FLAG_STOP_AT_EOT); -+ DWORD(buf + 0x0C), 0, ver, devmem, flags | FLAG_STOP_AT_EOT); - - if (opt.flags & FLAG_DUMP_BIN) - { diff --git a/dmidecode-06-hide-irrelevant-fixup-message.patch b/dmidecode-06-hide-irrelevant-fixup-message.patch deleted file mode 100644 index ebc48e6..0000000 --- a/dmidecode-06-hide-irrelevant-fixup-message.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Jean Delvare -Date: Tue, 3 May 2016 15:32:21 +0200 -Subject: dmidecode: Hide irrelevant fixup message -Git-commit: cff11afa886a0147d734b650755d232b5e7f2099 -References: http://savannah.nongnu.org/support/?109024 - -Only display the message about type 34 length fixup if the entry in -question is going to be displayed. Otherwise it's only confusing. - -This fixes bug #109024: -http://savannah.nongnu.org/support/?109024 - -Fixes: 3f70b3515d91 ("dmidecode: Fix up invalid DMI type 34 structure length") - ---- - dmidecode.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - ---- dmidecode-3.0.orig/dmidecode.c 2016-05-03 16:05:11.533919057 +0200 -+++ dmidecode-3.0/dmidecode.c 2016-05-03 16:05:13.223934786 +0200 -@@ -2946,7 +2946,7 @@ static void dmi_64bit_memory_error_addre - * first 5 characters of the device name to be trimmed. It's easy to - * check and fix, so do it, but warn. - */ --static void dmi_fixup_type_34(struct dmi_header *h) -+static void dmi_fixup_type_34(struct dmi_header *h, int display) - { - u8 *p = h->data; - -@@ -2954,7 +2954,9 @@ static void dmi_fixup_type_34(struct dmi - if (h->length == 0x10 - && is_printable(p + 0x0B, 0x10 - 0x0B)) - { -- printf("Invalid entry length (%u). Fixed up to %u.\n", 0x10, 0x0B); -+ if (!(opt.flags & FLAG_QUIET) && display) -+ printf("Invalid entry length (%u). Fixed up to %u.\n", -+ 0x10, 0x0B); - h->length = 0x0B; - } - } -@@ -4443,7 +4445,7 @@ static void dmi_table_decode(u8 *buf, u3 - - /* Fixup a common mistake */ - if (h.type == 34) -- dmi_fixup_type_34(&h); -+ dmi_fixup_type_34(&h, display); - - /* look for the next handle */ - next = data + h.length; diff --git a/dmidecode-07-only-decode-one-dmi-table.patch b/dmidecode-07-only-decode-one-dmi-table.patch deleted file mode 100644 index 7a1d6cd..0000000 --- a/dmidecode-07-only-decode-one-dmi-table.patch +++ /dev/null @@ -1,68 +0,0 @@ -From: Jean Delvare -Date: Fri, 20 Jan 2017 10:57:12 +0100 -Subject: Only decode one DMI table -Git-commit: 12fbde92a26da61eda9f2ff0ba3c316779163f10 -References: https://savannah.nongnu.org/bugs/?50022 - -Since version 3.0.0 of the SMBIOS specification, there can be -multiple entry points in memory, pointing to one or two DMI tables. -If both a 32-bit ("_SM_") entry point and a 64-bit ("_SM3_") entry -point are present, the specification requires that the latter points -to a table which is a super-set of the table pointed to by the -former. Therefore it makes no sense to decode both. - -Per specification, look for a 64-bit ("_SM3_") entry point first, and -if we can't find any, look for a 32-bit ("_SM_" or "_DMI_") entry -point. - -This fixes bug #50022: -https://savannah.nongnu.org/bugs/?50022 ---- - dmidecode.c | 19 ++++++++++++++----- - 1 file changed, 14 insertions(+), 5 deletions(-) - ---- a/dmidecode.c -+++ b/dmidecode.c -@@ -4903,28 +4903,37 @@ memory_scan: - goto exit_free; - } - -- for (fp = 0; fp <= 0xFFF0; fp += 16) -+ /* Look for a 64-bit entry point first */ -+ for (fp = 0; fp <= 0xFFE0; fp += 16) - { -- if (memcmp(buf + fp, "_SM3_", 5) == 0 && fp <= 0xFFE0) -+ if (memcmp(buf + fp, "_SM3_", 5) == 0) - { - if (smbios3_decode(buf + fp, opt.devmem, 0)) - { - found++; -- fp += 16; -+ goto done; - } - } -- else if (memcmp(buf + fp, "_SM_", 4) == 0 && fp <= 0xFFE0) -+ } -+ -+ /* If none found, look for a 32-bit entry point */ -+ for (fp = 0; fp <= 0xFFF0; fp += 16) -+ { -+ if (memcmp(buf + fp, "_SM_", 4) == 0 && fp <= 0xFFE0) - { - if (smbios_decode(buf + fp, opt.devmem, 0)) - { - found++; -- fp += 16; -+ goto done; - } - } - else if (memcmp(buf + fp, "_DMI_", 5) == 0) - { - if (legacy_decode(buf + fp, opt.devmem, 0)) -+ { - found++; -+ goto done; -+ } - } - } - diff --git a/dmidecode-3.0.tar.xz b/dmidecode-3.0.tar.xz deleted file mode 100644 index 6d4ee38..0000000 --- a/dmidecode-3.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ec35bb193729c1d593a1460b59d82d24b89102ab23fd0416e6cf4325d077e45 -size 58704 diff --git a/dmidecode-3.0.tar.xz.sig b/dmidecode-3.0.tar.xz.sig deleted file mode 100644 index 6bda5b0058f60f24e9f010158d426b399690d1055e8e6ba525d5aa2e4d7cc52c..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmV-H0KWf-KLZ5-Rp<9MhE|BsIPfpX5du}b0GtY98qszVp1M5ND-cgrEZkMm!Gr*x XK$(>wIiP$Y7GsXHiMUw*1i*b