From 5c1d1e2b11c35a52a6deb4b759b9f39fb96238e24d3792f8c12edb9224e8cd4c Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 30 Jun 2022 18:53:58 +0000 Subject: [PATCH] - Add 0001-testsuite-repair-read-of-uninitialized-memory.patch OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=206 --- ...-repair-read-of-uninitialized-memory.patch | 32 +++++++++++++++++++ kmod-testsuite.spec | 1 + kmod.changes | 1 + kmod.spec | 1 + 4 files changed, 35 insertions(+) create mode 100644 0001-testsuite-repair-read-of-uninitialized-memory.patch diff --git a/0001-testsuite-repair-read-of-uninitialized-memory.patch b/0001-testsuite-repair-read-of-uninitialized-memory.patch new file mode 100644 index 0000000..83ce79d --- /dev/null +++ b/0001-testsuite-repair-read-of-uninitialized-memory.patch @@ -0,0 +1,32 @@ +From f019428527c87530fb59caca7f2868ac2c5d5391 Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Thu, 30 Jun 2022 18:47:25 +0200 +Subject: [PATCH] testsuite: repair read of uninitialized memory +References: https://github.com/kmod-project/kmod/pull/15 +References: https://github.com/kmod-project/kmod/issues/14 + +Function ``test_backoff_time`` does not initialize ``delta``, and +``get_backoff_delta_msec`` then performs a read from uninitialized +memory with the ``!*delta`` expression. + +Signed-off-by: Jan Engelhardt +--- + testsuite/test-util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testsuite/test-util.c b/testsuite/test-util.c +index fb8c9ef..5766584 100644 +--- a/testsuite/test-util.c ++++ b/testsuite/test-util.c +@@ -231,7 +231,7 @@ DEFINE_TEST(test_addu64_overflow, + + static int test_backoff_time(const struct test *t) + { +- unsigned long long delta; ++ unsigned long long delta = 0; + + /* Check exponential increments */ + get_backoff_delta_msec(now_msec(), now_msec() + 10, &delta); +-- +2.36.1 + diff --git a/kmod-testsuite.spec b/kmod-testsuite.spec index 7f150af..a507e96 100644 --- a/kmod-testsuite.spec +++ b/kmod-testsuite.spec @@ -42,6 +42,7 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch +Patch9: 0001-testsuite-repair-read-of-uninitialized-memory.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook-xsl-stylesheets diff --git a/kmod.changes b/kmod.changes index e893967..bcfaf01 100644 --- a/kmod.changes +++ b/kmod.changes @@ -6,6 +6,7 @@ Thu Jun 30 16:15:35 UTC 2022 - Jan Engelhardt * modprobe: added the --wait option - Drop libkmod-Provide-info-even-for-modules-built-into-the.patch (merged) +- Add 0001-testsuite-repair-read-of-uninitialized-memory.patch ------------------------------------------------------------------- Mon Mar 28 15:01:46 UTC 2022 - Dirk Müller diff --git a/kmod.spec b/kmod.spec index b260a9c..3711385 100644 --- a/kmod.spec +++ b/kmod.spec @@ -42,6 +42,7 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch +Patch9: 0001-testsuite-repair-read-of-uninitialized-memory.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook-xsl-stylesheets