db-move: moved libdmapsharing from [testing] to [extra] (x86_64)
[arch-packages.git] / kmod / repos / core-x86_64 / 0001-master.patch
blobd655ca98580e64cf77896b834df66d0b3ec9fddf
1 From 16c086f48c2270ad6412ad7226df53079f825270 Mon Sep 17 00:00:00 2001
2 From: Jan Engelhardt <jengelh@inai.de>
3 Date: Thu, 30 Jun 2022 18:47:25 +0200
4 Subject: [PATCH 1/3] testsuite: repair read of uninitialized memory
6 Function ``test_backoff_time`` does not initialize ``delta``, and
7 ``get_backoff_delta_msec`` then performs a read from uninitialized
8 memory with the ``!*delta`` expression.
10 Signed-off-by: Jan Engelhardt <jengelh@inai.de>
11 Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
12 ---
13 testsuite/test-util.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
16 diff --git a/testsuite/test-util.c b/testsuite/test-util.c
17 index fb8c9ef..5766584 100644
18 --- a/testsuite/test-util.c
19 +++ b/testsuite/test-util.c
20 @@ -231,7 +231,7 @@ DEFINE_TEST(test_addu64_overflow,
22 static int test_backoff_time(const struct test *t)
24 - unsigned long long delta;
25 + unsigned long long delta = 0;
27 /* Check exponential increments */
28 get_backoff_delta_msec(now_msec(), now_msec() + 10, &delta);
30 From 09ad8605520c87e799cb89e2bcdf2f36e21f77ba Mon Sep 17 00:00:00 2001
31 From: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
32 Date: Thu, 24 Jun 2021 14:53:56 +0100
33 Subject: [PATCH 2/3] build: enable building & running tests from a subdir
35 During dpkg build, in a subdir, it is currently not possible to run
36 tests. Building testsuite/modules due to non-existance of the
37 testsuite directory under the build dir. Thus create it, when it is
38 not there.
40 Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
41 ---
42 Makefile.am | 1 +
43 1 file changed, 1 insertion(+)
45 diff --git a/Makefile.am b/Makefile.am
46 index 0e48770..b0a654c 100644
47 --- a/Makefile.am
48 +++ b/Makefile.am
49 @@ -255,6 +255,7 @@ CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) &
50 build-module-playground:
51 $(AM_V_GEN)if test "$(top_srcdir)" != "$(top_builddir)"; then \
52 $(RM) -rf testsuite/module-playground && \
53 + mkdir -p testsuite/ && \
54 cp -r $(top_srcdir)/$(MODULE_PLAYGROUND) $(top_builddir)/$(MODULE_PLAYGROUND) && \
55 find $(top_builddir)/$(MODULE_PLAYGROUND) -type d -exec chmod +w {} \; ; \
58 From c1fb98a30dae051ab69d23624d1e062d0527527e Mon Sep 17 00:00:00 2001
59 From: Quentin Armitage <quentin@armitage.org.uk>
60 Date: Fri, 19 Nov 2021 18:33:49 +0000
61 Subject: [PATCH 3/3] modprobe: Write error messages to syslog if stderr is
62 unavailable
64 The man page modprobe(8) states for the --syslog option:
65 "This is also automatically enabled when stderr is unavailable."
66 but it wasn't happening.
68 This commit now makes modprobe write to syslog if stderr is closed.
69 ---
70 tools/modprobe.c | 7 +++++++
71 1 file changed, 7 insertions(+)
73 diff --git a/tools/modprobe.c b/tools/modprobe.c
74 index 2a2ae21..3240c2b 100644
75 --- a/tools/modprobe.c
76 +++ b/tools/modprobe.c
77 @@ -819,6 +819,7 @@ static int do_modprobe(int argc, char **orig_argv)
78 int do_show_modversions = 0;
79 int do_show_exports = 0;
80 int err;
81 + struct stat stat_buf;
83 argv = prepend_options_from_env(&argc, orig_argv);
84 if (argv == NULL) {
85 @@ -947,6 +948,12 @@ static int do_modprobe(int argc, char **orig_argv)
86 args = argv + optind;
87 nargs = argc - optind;
89 + if (!use_syslog &&
90 + (!stderr ||
91 + fileno(stderr) == -1 ||
92 + fstat(fileno(stderr), &stat_buf)))
93 + use_syslog = 1;
95 log_open(use_syslog);
97 if (!do_show_config) {