From a21cb6636abb2550b7e83e0343fe57590de67f6961b3ab965371825607e1a3dd Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 18 Jan 2021 08:40:01 +0000 Subject: [PATCH] - Add patch fixing bsc#1178442 bsc#1177992 * acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff OBS-URL: https://build.opensuse.org/package/show/hardware/fwts?expand=0&rev=118 --- ...loops-when-length-is-incorrectly-zero.diff | 36 +++++++++++++++++++ fwts.changes | 6 ++++ fwts.spec | 4 ++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff diff --git a/acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff b/acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff new file mode 100644 index 0000000..aa5fd66 --- /dev/null +++ b/acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff @@ -0,0 +1,36 @@ +Index: fwts-20.12.00/src/acpi/pmtt/pmtt.c +=================================================================== +--- fwts-20.12.00.orig/src/acpi/pmtt/pmtt.c ++++ fwts-20.12.00/src/acpi/pmtt/pmtt.c +@@ -117,6 +117,14 @@ static void pmtt_controller_test(fwts_fr + offset += sizeof(fwts_acpi_table_pmtt_domain) * entry->domain_count; + header = (fwts_acpi_table_pmtt_header *) (((char *) entry) + offset); + while (offset < entry->header.length) { ++ ++ if (header->length == 0) { ++ fwts_failed(fw, LOG_LEVEL_CRITICAL, ++ "PMTTBadSubtableLength", ++ "PMTT Controller has a subtable with zero length"); ++ break; ++ } ++ + if (header->type == FWTS_ACPI_PMTT_TYPE_DIMM) { + pmtt_physical_component_test(fw, (fwts_acpi_table_pmtt_physical_component *) header, passed); + } else { +@@ -145,7 +153,16 @@ static void pmtt_socket_test(fwts_framew + + offset = sizeof(fwts_acpi_table_pmtt_socket); + header = (fwts_acpi_table_pmtt_header *) (((char *) entry) + offset); ++ + while (offset < entry->header.length) { ++ ++ if (header->length == 0) { ++ fwts_failed(fw, LOG_LEVEL_CRITICAL, ++ "PMTTBadSubtableLength", ++ "PMTT Socket has a subtable with zero length"); ++ break; ++ } ++ + if (header->type == FWTS_ACPI_PMTT_TYPE_CONTROLLER) { + pmtt_controller_test(fw, (fwts_acpi_table_pmtt_controller *) header, passed); + } else { diff --git a/fwts.changes b/fwts.changes index ee5f9a4..47faeb1 100644 --- a/fwts.changes +++ b/fwts.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 18 08:25:34 UTC 2021 - Martin Pluskal + +- Add patch fixing bsc#1178442 bsc#1177992 + * acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff + ------------------------------------------------------------------- Fri Dec 18 06:45:25 UTC 2020 - Martin Pluskal diff --git a/fwts.spec b/fwts.spec index ef581f2..86174c8 100644 --- a/fwts.spec +++ b/fwts.spec @@ -1,7 +1,7 @@ # # spec file for package fwts # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,6 +28,8 @@ Source0: https://fwts.ubuntu.com/release/%{name}-V%{version}.tar.gz Patch1: fwts-no-compiletime.patch # PATCH-FIX-OPENSUSE fwts-fix-non-acpi.patch Patch2: fwts-fix-non-acpi.patch +# PATCH-FIX-UPSTREAM acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff +Patch3: acpi-pmtt-fix-infinite-loops-when-length-is-incorrectly-zero.diff BuildRequires: autoconf BuildRequires: automake BuildRequires: bison