Hello community, here is the log from the commit of package fwts for openSUSE:Factory checked in at 2019-07-23 22:38:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fwts (Old) and /work/SRC/openSUSE:Factory/.fwts.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fwts" Tue Jul 23 22:38:32 2019 rev:41 rq:717835 version:19.06.00 Changes: -------- --- /work/SRC/openSUSE:Factory/fwts/fwts.changes 2019-06-01 09:52:21.151265850 +0200 +++ /work/SRC/openSUSE:Factory/.fwts.new.4126/fwts.changes 2019-07-23 22:38:34.158956623 +0200 @@ -1,0 +2,9 @@ +Tue Jul 23 10:15:09 UTC 2019 - Martin Pluskal <mplus...@suse.com> + +- Update to version 19.06.00: + * acpi/fadt: update latest FADT revision to 6.3 + * uefitime: add checking the EFI_UNSUPPORTED return code + * uefirtvariable: add checking the EFI_UNSUPPORTED return code + * uefirtmisc: add checking the EFI_UNSUPPORTED return code + +------------------------------------------------------------------- Old: ---- fwts-V19.05.00.tar.gz New: ---- fwts-V19.06.00.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fwts.spec ++++++ --- /var/tmp/diff_new_pack.y8ONgO/_old 2019-07-23 22:38:34.706956510 +0200 +++ /var/tmp/diff_new_pack.y8ONgO/_new 2019-07-23 22:38:34.706956510 +0200 @@ -17,7 +17,7 @@ Name: fwts -Version: 19.05.00 +Version: 19.06.00 Release: 0 Summary: Firmware Test Suite License: GPL-2.0-or-later ++++++ fwts-V19.05.00.tar.gz -> fwts-V19.06.00.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian/changelog new/debian/changelog --- old/debian/changelog 2019-05-16 10:29:51.000000000 +0200 +++ new/debian/changelog 2019-06-12 19:25:20.000000000 +0200 @@ -1,3 +1,38 @@ +fwts (19.06.00-0ubuntu1) eoan; urgency=medium + + [Alex Hung] + * acpi/fadt: update latest FADT revision to 6.3 + * apic: apicedge: remove irq < 16 is edge only + * mtrr: set severity to critical for incorrect attributes + + [Colin Ian King] + * acpi: s3: fix two memory leaks on fwts_get() calls and minor clean-ups + * fwts_summary: check for list creation failure + * fwts_modprobe: fix potential null pointer dereference + * cpu: cpufreq: avoid division by zero by initializing cpu_top_perf to 1 + * fwts_args: check for null text pointer + * fwts_log_plaintext: check for null pointer + * acpi: s3: check for null pointer + * lib: fwts_cpu: only assign a string if it has not yet been assigned + * acpi: syntaxcheck: nullify pointers to clean up static analysis warnings + * lib: fwts_log_scan: ensure accumulated error count is initialized + * lib: fwts_acpi_tables: remove redundant initialization of ret + * acpi: tcpa: remove redundant initialization of boolean passed + * acpi: dscdump: reduce scope of loop counter i + * acpi: method: reduce scope of boolean flag matching_levels + * lib: fwts_formatting: use simpler style for assigments + * uefi: uefirttime: make status static, cleans up cppcheck warnings + + [Erico Nunes] + * dsddump: fix Package loop condition + + [Ivan Hu] + * uefitime: add checking the EFI_UNSUPPORTED return code + * uefirtvariable: add checking the EFI_UNSUPPORTED return code + * uefirtmisc: add checking the EFI_UNSUPPORTED return code + + -- Alex Hung <alex.h...@ubuntu.com> Wed, 12 Jun 2019 10:24:53 -0700 + fwts (19.05.00-0ubuntu1) eoan; urgency=medium [Alex Hung] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapcraft.yaml new/snapcraft.yaml --- old/snapcraft.yaml 2019-05-16 10:29:51.000000000 +0200 +++ new/snapcraft.yaml 2019-06-12 19:25:20.000000000 +0200 @@ -1,5 +1,5 @@ name: fwts -version: V19.05.00 +version: V19.06.00 summary: The Firmware Test Suite (FWTS) description: This is a firmware test suite that performs sanity checks on system firmware. It is intended to identify BIOS and ACPI errors and if appropriate it will try to explain the errors and give advice to help workaround or fix firmware bugs. It is primarily intended to be a Linux-centric firmware troubleshooting tool. confinement: strict diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/acpi/dsddump/dsddump.c new/src/acpi/dsddump/dsddump.c --- old/src/acpi/dsddump/dsddump.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/acpi/dsddump/dsddump.c 2019-06-12 19:25:20.000000000 +0200 @@ -87,7 +87,7 @@ ACPI_OBJECT *sub_pkg = &element->Package.Elements[1]; uint32_t j; - for (j = 0; i < sub_pkg->Package.Count; j++) + for (j = 0; j < sub_pkg->Package.Count; j++) print_package_element(fw, &sub_pkg->Package.Elements[j]); } else print_package_element(fw, &element->Package.Elements[1]); @@ -144,7 +144,6 @@ ACPI_OBJECT_LIST arg_list; ACPI_OBJECT *obj; ACPI_BUFFER buf; - uint32_t i; int ret; arg_list.Count = 0; @@ -161,6 +160,7 @@ (obj->Package.Elements[0].Type == ACPI_TYPE_BUFFER) && (obj->Package.Elements[0].Buffer.Pointer != NULL) && (obj->Package.Elements[0].Buffer.Length == 16)) { + uint32_t i; fwts_log_info_verbatim(fw, "Name: %s", name); for (i = 0; i < obj->Package.Count; i += 2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/acpi/fadt/fadt.c new/src/acpi/fadt/fadt.c --- old/src/acpi/fadt/fadt.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/acpi/fadt/fadt.c 2019-06-12 19:25:20.000000000 +0200 @@ -198,7 +198,7 @@ static int fadt_revision(fwts_framework *fw) { const uint8_t LATEST_MAJOR = 6; - const uint8_t LATEST_MINOR = 2; + const uint8_t LATEST_MINOR = 3; uint8_t major; uint8_t minor; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/acpi/method/method.c new/src/acpi/method/method.c --- old/src/acpi/method/method.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/acpi/method/method.c 2019-06-12 19:25:20.000000000 +0200 @@ -5739,7 +5739,6 @@ uint32_t i; bool failed = false; bool ascending_levels = false; - bool matching_levels; char *str = NULL; FWTS_UNUSED(private); @@ -5812,7 +5811,8 @@ } if (!access("/sys/class/backlight/acpi_video0", R_OK)) { - matching_levels = false; + bool matching_levels = false; + for (i = 2; i < obj->Package.Count; i++) { if (obj->Package.Elements[0].Integer.Value == obj->Package.Elements[i].Integer.Value) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/acpi/s3/s3.c new/src/acpi/s3/s3.c --- old/src/acpi/s3/s3.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/acpi/s3/s3.c 2019-06-12 19:25:20.000000000 +0200 @@ -52,7 +52,12 @@ static int s3_init(fwts_framework *fw) { - /* Pre-init - make sure wakealarm works so that we can wake up after suspend */ + char *str; + + /* + * Pre-init - make sure wakealarm works so that we can + * wake up after suspend + */ if (fwts_wakealarm_test_firing(fw, 1) != FWTS_OK) { fwts_log_error(fw, "Cannot automatically wake machine up - aborting Sleep test."); fwts_failed(fw, LOG_LEVEL_MEDIUM, "BadWakeAlarmSleep", @@ -60,10 +65,13 @@ return FWTS_ERROR; } - if (fwts_get(PM_SUPEND_PATH) != NULL && strstr(fwts_get(PM_SUPEND_PATH), "[s2idle]")) + str = fwts_get(PM_SUPEND_PATH); + if (str && strstr(str, "[s2idle]")) { strncpy(sleep_type, "s2idle", strlen("s2idle") + 1); - else + free(str); + } else { strncpy(sleep_type, "S3", strlen("S3") + 1); + } return FWTS_OK; } @@ -543,8 +551,9 @@ fwts_progress_message(fw, percent, "(Checking logs for errors)"); klog_diff = fwts_klog_find_changes(klog_pre, klog_post); - s3_check_log(fw, klog_diff, &klog_errors, &klog_oopses, &klog_warn_ons, - &suspend_too_long, &resume_too_long); + if (klog_diff) + s3_check_log(fw, klog_diff, &klog_errors, &klog_oopses, &klog_warn_ons, + &suspend_too_long, &resume_too_long); fwts_klog_free(klog_pre); fwts_klog_free(klog_post); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/acpi/syntaxcheck/syntaxcheck.c new/src/acpi/syntaxcheck/syntaxcheck.c --- old/src/acpi/syntaxcheck/syntaxcheck.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/acpi/syntaxcheck/syntaxcheck.c 2019-06-12 19:25:20.000000000 +0200 @@ -495,7 +495,9 @@ int errors = 0; int warnings = 0; int remarks = 0; - fwts_list *iasl_stdout, *iasl_stderr, *iasl_disassembly; + fwts_list *iasl_stdout = NULL, + *iasl_stderr = NULL, + *iasl_disassembly = NULL; if (fwts_iasl_reassemble(fw, info, &iasl_disassembly, &iasl_stdout, &iasl_stderr) != FWTS_OK) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/acpi/tcpa/tcpa.c new/src/acpi/tcpa/tcpa.c --- old/src/acpi/tcpa/tcpa.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/acpi/tcpa/tcpa.c 2019-06-12 19:25:20.000000000 +0200 @@ -171,7 +171,7 @@ static int tcpa_test1(fwts_framework *fw) { fwts_acpi_table_tcpa *tcpa = (fwts_acpi_table_tcpa*)table->data; - bool passed = true; + bool passed; switch (tcpa->platform_class) { case 0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/apic/apicedge/apicedge.c new/src/apic/apicedge/apicedge.c --- old/src/apic/apicedge/apicedge.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/apic/apicedge/apicedge.c 2019-06-12 19:25:20.000000000 +0200 @@ -37,7 +37,7 @@ /* * This test sanity checks apic irq information * rule of thumb: - * interrupts <16 should be EDGE + * interrupts <16 should be EDGE or LEVEL * interrupts >16 should be LEVEL * acpi interrupt should be LEVEL */ @@ -86,10 +86,7 @@ "ACPI Interrupt is incorrectly edge triggered."); continue; } - if ((irq < 15) && (edge == NOT_EDGE)) - fwts_failed(fw, LOG_LEVEL_MEDIUM, - "LegacyIRQLevelTrig", - "Legacy interrupt %i is incorrectly level triggered.", irq); + if ((irq < 15) && (edge == UNDEFINED)) fwts_failed(fw, LOG_LEVEL_MEDIUM, "NonLegacyIRQLevelTrig", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/bios/mtrr/mtrr.c new/src/bios/mtrr/mtrr.c --- old/src/bios/mtrr/mtrr.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/bios/mtrr/mtrr.c 2019-06-12 19:25:20.000000000 +0200 @@ -495,7 +495,7 @@ if ((type & type_mustnot) != 0) { failed++; - fwts_failed(fw, LOG_LEVEL_MEDIUM, + fwts_failed(fw, LOG_LEVEL_CRITICAL, "MTRRIncorrectAttr", "Memory range 0x%" PRIx64 " to 0x%" PRIx64 " (%s) " "has incorrect attribute%s.", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/cpu/cpufreq/cpufreq.c new/src/cpu/cpufreq/cpufreq.c --- old/src/cpu/cpufreq/cpufreq.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/cpu/cpufreq/cpufreq.c 2019-06-12 19:25:20.000000000 +0200 @@ -279,7 +279,7 @@ static int test_one_cpu_performance(fwts_framework *fw, struct cpu *cpu, int cpu_idx, int n_online_cpus) { - uint64_t cpu_top_perf = 0; + uint64_t cpu_top_perf = 1; int i; for (i = 0; i < cpu->n_freqs; i++) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/include/fwts_version.h new/src/lib/include/fwts_version.h --- old/src/lib/include/fwts_version.h 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/include/fwts_version.h 2019-06-12 19:25:20.000000000 +0200 @@ -16,5 +16,5 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ -#define FWTS_VERSION "V19.05.00" -#define FWTS_DATE "2019-05-16 08:29:51" +#define FWTS_VERSION "V19.06.00" +#define FWTS_DATE "2019-06-12 17:25:20" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_acpi_tables.c new/src/lib/src/fwts_acpi_tables.c --- old/src/lib/src/fwts_acpi_tables.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_acpi_tables.c 2019-06-12 19:25:20.000000000 +0200 @@ -1204,7 +1204,7 @@ */ int fwts_acpi_load_tables(fwts_framework *fw) { - int ret = FWTS_ERROR; + int ret; bool require_fixup = false; if (fw->acpi_table_path != NULL) { @@ -1221,8 +1221,9 @@ ret = fwts_acpi_load_tables_from_sysfs(fw); require_fixup = true; } - } else + } else { ret = FWTS_ERROR_NO_PRIV; + } if (ret == FWTS_OK) { acpi_tables_loaded = ACPI_TABLES_LOADED_OK; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_args.c new/src/lib/src/fwts_args.c --- old/src/lib/src/fwts_args.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_args.c 2019-06-12 19:25:20.000000000 +0200 @@ -274,6 +274,8 @@ text = fwts_format_text(explanation, width < 0 ? (FWTS_MIN_TTY_WIDTH - FWTS_ARGS_WIDTH-1) : width); + if (!text) + return; fwts_list_foreach(item, text) { printf("%-*.*s %s\n", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_cpu.c new/src/lib/src/fwts_cpu.c --- old/src/lib/src/fwts_cpu.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_cpu.c 2019-06-12 19:25:20.000000000 +0200 @@ -151,7 +151,7 @@ found = true; - if (!strncmp(buffer, "vendor_id", 9)) { + if (!cpu->vendor_id && !strncmp(buffer, "vendor_id", 9)) { cpu->vendor_id = strdup(ptr); continue; } @@ -159,7 +159,7 @@ sscanf(ptr, "%d", &cpu->x86); continue; } - if (!strncmp(buffer, "model name", 10)) { + if (!cpu->model_name && !strncmp(buffer, "model name", 10)) { cpu->model_name = strdup(ptr); continue; } @@ -171,7 +171,7 @@ sscanf(ptr, "%d", &cpu->stepping); continue; } - if (!strncmp(buffer, "flags", 5)) { + if (!cpu->flags && !strncmp(buffer, "flags", 5)) { cpu->flags = strdup(ptr); continue; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_formatting.c new/src/lib/src/fwts_formatting.c --- old/src/lib/src/fwts_formatting.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_formatting.c 2019-06-12 19:25:20.000000000 +0200 @@ -40,9 +40,11 @@ if (maxlen < width) maxlen = width; - if ((bufptr = buffer = calloc(1, maxlen + 1)) == NULL) + buffer = calloc(1, maxlen + 1); + if (!buffer) return NULL; + bufptr = buffer; while (*start && start < end) *bufptr++ = *start++; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_log_plaintext.c new/src/lib/src/fwts_log_plaintext.c --- old/src/lib/src/fwts_log_plaintext.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_log_plaintext.c 2019-06-12 19:25:20.000000000 +0200 @@ -130,6 +130,8 @@ else lines = fwts_format_text(tmpbuf + header_len, log_file->line_width - header_len); + if (!lines) + return 0; len = n; fwts_list_foreach(item, lines) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_log_scan.c new/src/lib/src/fwts_log_scan.c --- old/src/lib/src/fwts_log_scan.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_log_scan.c 2019-06-12 19:25:20.000000000 +0200 @@ -365,6 +365,8 @@ json_object *log_table; fwts_log_pattern *patterns; + *errors = 0; + /* * json_object_from_file() can fail when files aren't readable * so check if we can open for read before calling json_object_from_file() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_modprobe.c new/src/lib/src/fwts_modprobe.c --- old/src/lib/src/fwts_modprobe.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_modprobe.c 2019-06-12 19:25:20.000000000 +0200 @@ -131,7 +131,7 @@ while (fgets(buffer, sizeof(buffer) - 1, fp) != NULL) { char *ptr = strchr(buffer, ' '); - if (*ptr) + if (ptr) *ptr = '\0'; if (!strcmp(buffer, module)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/lib/src/fwts_summary.c new/src/lib/src/fwts_summary.c --- old/src/lib/src/fwts_summary.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/lib/src/fwts_summary.c 2019-06-12 19:25:20.000000000 +0200 @@ -233,6 +233,11 @@ fwts_list_link *item; fwts_list *sorted = fwts_list_new(); + if (!sorted) { + fwts_log_error(fw, "Out of memory allocating test summary list"); + return FWTS_ERROR; + } + fwts_list_foreach(item, test_list) fwts_list_add_ordered(sorted, fwts_list_data(fwts_framework_test *,item), fwts_framework_compare_test_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/uefi/uefirtmisc/uefirtmisc.c new/src/uefi/uefirtmisc/uefirtmisc.c --- old/src/uefi/uefirtmisc/uefirtmisc.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/uefi/uefirtmisc/uefirtmisc.c 2019-06-12 19:25:20.000000000 +0200 @@ -89,6 +89,11 @@ long ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTHIGHMONOTONICCOUNT, &getnexthighmonotoniccount); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetNextHighMonotonicCount runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextHighMonotonicCount", "Failed to get high monotonic count with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -229,6 +234,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTHIGHMONOTONICCOUNT, &getnexthighmonotoniccount); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetNextHighMonotonicCount runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if (status == EFI_INVALID_PARAMETER) { fwts_passed(fw, "Test with invalid NULL parameter returned " "EFI_INVALID_PARAMETER as expected."); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/uefi/uefirttime/uefirttime.c new/src/uefi/uefirttime/uefirttime.c --- old/src/uefi/uefirttime/uefirttime.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/uefi/uefirttime/uefirttime.c 2019-06-12 19:25:20.000000000 +0200 @@ -215,6 +215,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", "Failed to get time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -244,6 +249,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if (status == EFI_INVALID_PARAMETER) { fwts_passed(fw, "UEFI runtime service GetTime interface test " "passed, returned EFI_INVALID_PARAMETER as expected."); @@ -291,6 +301,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", "Failed to get time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -330,6 +345,11 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_TIME, &settime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", "Failed to set time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -344,6 +364,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", "Failed to get time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -385,6 +410,11 @@ status = ~0ULL; ioret = ioctl(fd, EFI_RUNTIME_SET_TIME, &settime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", "Failed to set time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -401,12 +431,18 @@ struct efi_settime *settime) { long ioret; - uint64_t status = ~0ULL; + static uint64_t status; + status = ~0ULL; settime->status = &status; ioret = ioctl(fd, EFI_RUNTIME_SET_TIME, settime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if (status == EFI_INVALID_PARAMETER) { fwts_passed(fw, "UEFI runtime service SetTime interface test " "passed, returned EFI_INVALID_PARAMETER as expected."); @@ -439,6 +475,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", "Failed to get wakeup time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -474,6 +515,11 @@ settime.status = &status; ioret = ioctl(fd, EFI_RUNTIME_SET_TIME, &settime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", "Failed to set wakeup time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -627,7 +673,7 @@ if (status == EFI_UNSUPPORTED) { fwts_skipped(fw, "Skipping test, GetWakeupTime runtime " "service is not supported on this platform."); - return FWTS_OK; + return FWTS_SKIP; } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", "Failed to get wakeup time with UEFI runtime service."); @@ -648,22 +694,26 @@ struct efi_getwakeuptime *getwakeuptime) { long ioret; - uint64_t status = ~0ULL; + static uint64_t status; + + status = ~0ULL; getwakeuptime->status = &status; ioret = ioctl(fd, EFI_RUNTIME_GET_WAKETIME, getwakeuptime); if (ioret == -1) { - if (status == EFI_INVALID_PARAMETER || - status == EFI_UNSUPPORTED) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetTimeWakeupTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } + if (status == EFI_INVALID_PARAMETER) { fwts_passed(fw, "UEFI runtime service GetTimeWakeupTime interface test " - "passed, returned EFI_INVALID_PARAMETER or " - "EFI_UNSUPPORTED as expected."); + "passed, returned EFI_INVALID_PARAMETER as expected."); return FWTS_OK; } else { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", "Failed to get correct return status from UEFI " - "runtime service, expecting EFI_INVALID_PARAMETER " - "or EFI_UNSUPPORTED."); + "runtime service, expecting EFI_INVALID_PARAMETER."); fwts_uefi_print_status_info(fw, status); return FWTS_ERROR; } @@ -743,6 +793,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", "Failed to get time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -760,9 +815,9 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_WAKETIME, &setwakeuptime); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - fwts_skipped(fw, "Skipping test, GetWakeupTime runtime " + fwts_skipped(fw, "Skipping test, SetWakeupTime runtime " "service is not supported on this platform."); - return FWTS_OK; + return FWTS_SKIP; } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", "Failed to set wakeup time with UEFI runtime service."); @@ -783,7 +838,7 @@ if (status == EFI_UNSUPPORTED) { fwts_skipped(fw, "Skipping test, GetWakeupTime runtime " "service is not supported on this platform."); - return FWTS_OK; + return FWTS_SKIP; } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", "Failed to get wakeup time with UEFI runtime service."); @@ -815,6 +870,11 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_WAKETIME, &setwakeuptime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetWakeupTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", "Failed to set wakeup time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -829,7 +889,7 @@ if (status == EFI_UNSUPPORTED) { fwts_skipped(fw, "Skipping test, GetWakeupTime runtime " "service is not supported on this platform."); - return FWTS_OK; + return FWTS_SKIP; } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", "Failed to get wakeup time with UEFI runtime service."); @@ -854,16 +914,17 @@ ) { long ioret; - uint64_t status = ~0ULL; + static uint64_t status; + status = ~0ULL; setwakeuptime->status = &status; ioret = ioctl(fd, EFI_RUNTIME_SET_WAKETIME, setwakeuptime); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - fwts_skipped(fw, "Skipping test, GetWakeupTime runtime " + fwts_skipped(fw, "Skipping test, SetWakeupTime runtime " "service is not supported on this platform."); - return FWTS_OK; + return FWTS_SKIP; } if (status == EFI_INVALID_PARAMETER) { fwts_passed(fw, "UEFI runtime service SetTimeWakeupTime interface test " @@ -912,7 +973,7 @@ if (status == EFI_UNSUPPORTED) { fwts_skipped(fw, "Skipping test, GetWakeupTime runtime " "service is not supported on this platform."); - return FWTS_OK; + return FWTS_SKIP; } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", "Failed to get wakeup time with UEFI runtime service."); @@ -951,6 +1012,11 @@ setwakeuptime.Enabled = true; ioret = ioctl(fd, EFI_RUNTIME_SET_WAKETIME, &setwakeuptime); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetWakeupTime runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", "Failed to set wakeup time with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/src/uefi/uefirtvariable/uefirtvariable.c new/src/uefi/uefirtvariable/uefirtvariable.c --- old/src/uefi/uefirtvariable/uefirtvariable.c 2019-05-16 10:29:51.000000000 +0200 +++ new/src/uefi/uefirtvariable/uefirtvariable.c 2019-06-12 19:25:20.000000000 +0200 @@ -156,6 +156,11 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetVariable runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if (status == EFI_OUT_OF_RESOURCES) { fwts_uefi_print_status_info(fw, status); fwts_skipped(fw, @@ -184,6 +189,11 @@ status = ~0ULL; ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, &getvariable); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetVariable runtime " + "service is not supported on this platform."); + goto err_restore_env; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetVariable", "Failed to get variable with UEFI " @@ -323,6 +333,11 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetVariable runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if (status == EFI_OUT_OF_RESOURCES) { fwts_uefi_print_status_info(fw, status); fwts_skipped(fw, @@ -362,7 +377,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); if (ioret == -1) { - + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetNextVariableName runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } /* no next variable was found*/ if (*getnextvariablename.status == EFI_NOT_FOUND) break; @@ -512,7 +531,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); if (ioret == -1) { - + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetNextVariableName runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } /* no next variable was found*/ if (*getnextvariablename.status == EFI_NOT_FOUND) break; @@ -673,7 +696,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); if (ioret == -1) { - + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetNextVariableName runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } /* no next variable was found*/ if (*getnextvariablename.status == EFI_NOT_FOUND) break; @@ -789,6 +816,14 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetNextVaiableName runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } + } + if (ioret != -1 || status != EFI_INVALID_PARAMETER) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVariableName", @@ -899,6 +934,11 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetVariable runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if ((status == EFI_INVALID_PARAMETER) && ((attributes & FWTS_UEFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS) || (attributes & FWTS_UEFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) || @@ -966,6 +1006,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, &getvariable); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetVariable runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetVariable", "Failed to get variable with UEFI runtime service."); fwts_uefi_print_status_info(fw, status); @@ -1020,9 +1065,13 @@ getvariable.status = &status; ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, &getvariable); - /* expect the uefi runtime interface return EFI_NOT_FOUND */ if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetVariable runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if (*getvariable.status == EFI_NOT_FOUND) return FWTS_OK; } @@ -1059,6 +1108,13 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetVariable runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } + } if ((status == EFI_SUCCESS) && (ioret != -1)) { if ((attributes & FWTS_UEFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS) && (attributes & FWTS_UEFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) && @@ -1467,6 +1523,11 @@ ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetVariable runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } if (status == EFI_OUT_OF_RESOURCES) { fwts_uefi_print_status_info(fw, status); fwts_skipped(fw, @@ -1495,6 +1556,11 @@ ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetNextVariableName runtime " + "service is not supported on this platform."); + return FWTS_SKIP; + } fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVariableName", "Failed to get next variable name with " @@ -1838,7 +1904,13 @@ *(getvariable->status) = ~0ULL; ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, getvariable); + if (ioret == -1) { + if (*(getvariable->status) == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, GetVariable runtime " + "service is not supported on this platform."); + return; + } if (*(getvariable->status) == EFI_INVALID_PARAMETER) { fwts_passed(fw, "GetVariable with %s returned error " "EFI_INVALID_PARAMETER as expected.", test); @@ -1882,7 +1954,13 @@ setvariable.status = &status; ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { + fwts_skipped(fw, "Skipping test, SetVariable runtime " + "service is not supported on this platform."); + return FWTS_OK; + } if (status == EFI_OUT_OF_RESOURCES) { fwts_uefi_print_status_info(fw, status); fwts_skipped(fw,