From 812ca2406af1fd327e6971eadfe9bcb4df3db006 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 27 2021 04:19:55 +0000 Subject: import systemd-239-49.el8 --- diff --git a/SOURCES/0598-remove-a-left-over-break.patch b/SOURCES/0598-remove-a-left-over-break.patch new file mode 100644 index 0000000..7d68ff0 --- /dev/null +++ b/SOURCES/0598-remove-a-left-over-break.patch @@ -0,0 +1,29 @@ +From 5944138a54017fc8f1f4c878a1eea96ea18736c4 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Fri, 25 Jun 2021 10:42:53 +0200 +Subject: [PATCH] remove a left-over break + +By the "same logic as above...", we want to continue to fallback here, +but the break prohibits that. + +This is a follow-up for ee1aa61c4710ae567a2b844e0f0bb8cb0456ab8c . + +(cherry picked from commit 99df1cb6f50875db513a5b45f18191460a150f3d) + +Related: #1970860 +--- + src/basic/copy.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/basic/copy.c b/src/basic/copy.c +index a48c42c5c6..1a0db29ac9 100644 +--- a/src/basic/copy.c ++++ b/src/basic/copy.c +@@ -218,7 +218,6 @@ int copy_bytes_full( + break; + + try_sendfile = try_splice = false; /* same logic as above for copy_file_range() */ +- break; + } else + /* Success! */ + goto next; diff --git a/SOURCES/0599-basic-unit-name-do-not-use-strdupa-on-a-path.patch b/SOURCES/0599-basic-unit-name-do-not-use-strdupa-on-a-path.patch new file mode 100644 index 0000000..adf5607 --- /dev/null +++ b/SOURCES/0599-basic-unit-name-do-not-use-strdupa-on-a-path.patch @@ -0,0 +1,65 @@ +From c5d2964d498da0ac06799e5f040de74a0f5d2deb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Wed, 23 Jun 2021 11:46:41 +0200 +Subject: [PATCH] basic/unit-name: do not use strdupa() on a path + +The path may have unbounded length, for example through a fuse mount. + +CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and +ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo +and each mountpoint is passed to mount_setup_unit(), which calls +unit_name_path_escape() underneath. A local attacker who is able to mount a +filesystem with a very long path can crash systemd and the whole system. + +https://bugzilla.redhat.com/show_bug.cgi?id=1970887 + +The resulting string length is bounded by UNIT_NAME_MAX, which is 256. But we +can't easily check the length after simplification before doing the +simplification, which in turns uses a copy of the string we can write to. +So we can't reject paths that are too long before doing the duplication. +Hence the most obvious solution is to switch back to strdup(), as before +7410616cd9dbbec97cf98d75324da5cda2b2f7a2. + +Resolves: #1974700 + +(cherry picked from commit 441e0115646d54f080e5c3bb0ba477c892861ab9) +--- + src/basic/unit-name.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c +index 1b81fe268f..614eb8649b 100644 +--- a/src/basic/unit-name.c ++++ b/src/basic/unit-name.c +@@ -369,12 +369,13 @@ int unit_name_unescape(const char *f, char **ret) { + } + + int unit_name_path_escape(const char *f, char **ret) { +- char *p, *s; ++ _cleanup_free_ char *p = NULL; ++ char *s; + + assert(f); + assert(ret); + +- p = strdupa(f); ++ p = strdup(f); + if (!p) + return -ENOMEM; + +@@ -386,13 +387,9 @@ int unit_name_path_escape(const char *f, char **ret) { + if (!path_is_normalized(p)) + return -EINVAL; + +- /* Truncate trailing slashes */ ++ /* Truncate trailing slashes and skip leading slashes */ + delete_trailing_chars(p, "/"); +- +- /* Truncate leading slashes */ +- p = skip_leading_chars(p, "/"); +- +- s = unit_name_escape(p); ++ s = unit_name_escape(skip_leading_chars(p, "/")); + } + if (!s) + return -ENOMEM; diff --git a/SOURCES/0600-sd-event-change-ordering-of-pending-ratelimited-even.patch b/SOURCES/0600-sd-event-change-ordering-of-pending-ratelimited-even.patch new file mode 100644 index 0000000..84836ab --- /dev/null +++ b/SOURCES/0600-sd-event-change-ordering-of-pending-ratelimited-even.patch @@ -0,0 +1,96 @@ +From f863f89d8a5cbb47676d5114e349918c4e009fe5 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 8 Jun 2021 00:07:51 -0700 +Subject: [PATCH] sd-event: change ordering of pending/ratelimited events + +Instead of ordering non-pending before pending we should order +"non-pending OR ratelimited" before "pending AND not-ratelimited". +This fixes a bug where ratelimited events were ordered at the end of the +priority queue and could be stuck there for an indeterminate amount of +time. + +(cherry picked from commit 81107b8419c39f726fd2805517a5b9faab204e59) + +Related: #1968528 +--- + src/libsystemd/sd-event/sd-event.c | 48 +++++++++++++----------------- + 1 file changed, 20 insertions(+), 28 deletions(-) + +diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c +index be912d94e3..3e77f4e810 100644 +--- a/src/libsystemd/sd-event/sd-event.c ++++ b/src/libsystemd/sd-event/sd-event.c +@@ -427,25 +427,6 @@ static usec_t time_event_source_next(const sd_event_source *s) { + return USEC_INFINITY; + } + +-static int earliest_time_prioq_compare(const void *a, const void *b) { +- const sd_event_source *x = a, *y = b; +- +- /* Enabled ones first */ +- if (x->enabled != SD_EVENT_OFF && y->enabled == SD_EVENT_OFF) +- return -1; +- if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF) +- return 1; +- +- /* Move the pending ones to the end */ +- if (!x->pending && y->pending) +- return -1; +- if (x->pending && !y->pending) +- return 1; +- +- /* Order by time */ +- return CMP(time_event_source_next(x), time_event_source_next(y)); +-} +- + static usec_t time_event_source_latest(const sd_event_source *s) { + assert(s); + +@@ -464,7 +445,15 @@ static usec_t time_event_source_latest(const sd_event_source *s) { + return USEC_INFINITY; + } + +-static int latest_time_prioq_compare(const void *a, const void *b) { ++static bool event_source_timer_candidate(const sd_event_source *s) { ++ assert(s); ++ ++ /* Returns true for event sources that either are not pending yet (i.e. where it's worth to mark them pending) ++ * or which are currently ratelimited (i.e. where it's worth leaving the ratelimited state) */ ++ return !s->pending || s->ratelimited; ++} ++ ++static int time_prioq_compare(const void *a, const void *b, usec_t (*time_func)(const sd_event_source *s)) { + const sd_event_source *x = a, *y = b; + + /* Enabled ones first */ +@@ -473,19 +462,22 @@ static int latest_time_prioq_compare(const void *a, const void *b) { + if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF) + return 1; + +- /* Move the pending ones to the end */ +- if (!x->pending && y->pending) ++ /* Order "non-pending OR ratelimited" before "pending AND not-ratelimited" */ ++ if (event_source_timer_candidate(x) && !event_source_timer_candidate(y)) + return -1; +- if (x->pending && !y->pending) ++ if (!event_source_timer_candidate(x) && event_source_timer_candidate(y)) + return 1; + + /* Order by time */ +- if (time_event_source_latest(x) < time_event_source_latest(y)) +- return -1; +- if (time_event_source_latest(x) > time_event_source_latest(y)) +- return 1; ++ return CMP(time_func(x), time_func(y)); ++} + +- return 0; ++static int earliest_time_prioq_compare(const void *a, const void *b) { ++ return time_prioq_compare(a, b, time_event_source_next); ++} ++ ++static int latest_time_prioq_compare(const void *a, const void *b) { ++ return time_prioq_compare(a, b, time_event_source_latest); + } + + static int exit_prioq_compare(const void *a, const void *b) { diff --git a/SOURCES/0601-sd-event-drop-unnecessary-else.patch b/SOURCES/0601-sd-event-drop-unnecessary-else.patch new file mode 100644 index 0000000..d63606d --- /dev/null +++ b/SOURCES/0601-sd-event-drop-unnecessary-else.patch @@ -0,0 +1,27 @@ +From 9faf4d1a39b7fc8c9f986a808e1c0d3ed9b44357 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Tue, 15 Jun 2021 00:44:04 +0900 +Subject: [PATCH] sd-event: drop unnecessary "else" + +(cherry picked from commit 7e2bf71ca3638e36ee33215ceee386ba8013da6d) + +Related: #1968528 +--- + src/libsystemd/sd-event/sd-event.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c +index 3e77f4e810..2b0b76aa1c 100644 +--- a/src/libsystemd/sd-event/sd-event.c ++++ b/src/libsystemd/sd-event/sd-event.c +@@ -2883,8 +2883,8 @@ static int event_arm_timer( + + if (!d->needs_rearm) + return 0; +- else +- d->needs_rearm = false; ++ ++ d->needs_rearm = false; + + a = prioq_peek(d->earliest); + if (!a || a->enabled == SD_EVENT_OFF || time_event_source_next(a) == USEC_INFINITY) { diff --git a/SOURCES/0602-sd-event-use-CMP-macro.patch b/SOURCES/0602-sd-event-use-CMP-macro.patch new file mode 100644 index 0000000..2cf6223 --- /dev/null +++ b/SOURCES/0602-sd-event-use-CMP-macro.patch @@ -0,0 +1,90 @@ +From 7419222d3811d60c0a8f5ea27778108a1ca8ee71 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Tue, 15 Jun 2021 00:51:33 +0900 +Subject: [PATCH] sd-event: use CMP() macro + +(cherry picked from commit 06e131477d82b83c5d516e66d6e413affd7c774a) + +Related: #1968528 +--- + src/libsystemd/sd-event/sd-event.c | 37 ++++++++++++++---------------- + 1 file changed, 17 insertions(+), 20 deletions(-) + +diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c +index 2b0b76aa1c..6a20b658e4 100644 +--- a/src/libsystemd/sd-event/sd-event.c ++++ b/src/libsystemd/sd-event/sd-event.c +@@ -358,10 +358,9 @@ static int pending_prioq_compare(const void *a, const void *b) { + assert(y->pending); + + /* Enabled ones first */ +- if (x->enabled != SD_EVENT_OFF && y->enabled == SD_EVENT_OFF) +- return -1; +- if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF) +- return 1; ++ r = CMP(x->enabled == SD_EVENT_OFF, y->enabled == SD_EVENT_OFF); ++ if (r != 0) ++ return r; + + /* Non rate-limited ones first. */ + r = CMP(!!x->ratelimited, !!y->ratelimited); +@@ -385,10 +384,9 @@ static int prepare_prioq_compare(const void *a, const void *b) { + assert(y->prepare); + + /* Enabled ones first */ +- if (x->enabled != SD_EVENT_OFF && y->enabled == SD_EVENT_OFF) +- return -1; +- if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF) +- return 1; ++ r = CMP(x->enabled == SD_EVENT_OFF, y->enabled == SD_EVENT_OFF); ++ if (r != 0) ++ return r; + + /* Non rate-limited ones first. */ + r = CMP(!!x->ratelimited, !!y->ratelimited); +@@ -455,18 +453,17 @@ static bool event_source_timer_candidate(const sd_event_source *s) { + + static int time_prioq_compare(const void *a, const void *b, usec_t (*time_func)(const sd_event_source *s)) { + const sd_event_source *x = a, *y = b; ++ int r; + + /* Enabled ones first */ +- if (x->enabled != SD_EVENT_OFF && y->enabled == SD_EVENT_OFF) +- return -1; +- if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF) +- return 1; ++ r = CMP(x->enabled == SD_EVENT_OFF, y->enabled == SD_EVENT_OFF); ++ if (r != 0) ++ return r; + + /* Order "non-pending OR ratelimited" before "pending AND not-ratelimited" */ +- if (event_source_timer_candidate(x) && !event_source_timer_candidate(y)) +- return -1; +- if (!event_source_timer_candidate(x) && event_source_timer_candidate(y)) +- return 1; ++ r = CMP(!event_source_timer_candidate(x), !event_source_timer_candidate(y)); ++ if (r != 0) ++ return r; + + /* Order by time */ + return CMP(time_func(x), time_func(y)); +@@ -482,15 +479,15 @@ static int latest_time_prioq_compare(const void *a, const void *b) { + + static int exit_prioq_compare(const void *a, const void *b) { + const sd_event_source *x = a, *y = b; ++ int r; + + assert(x->type == SOURCE_EXIT); + assert(y->type == SOURCE_EXIT); + + /* Enabled ones first */ +- if (x->enabled != SD_EVENT_OFF && y->enabled == SD_EVENT_OFF) +- return -1; +- if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF) +- return 1; ++ r = CMP(x->enabled == SD_EVENT_OFF, y->enabled == SD_EVENT_OFF); ++ if (r != 0) ++ return r; + + /* Lower priority values first */ + if (x->priority < y->priority) diff --git a/SOURCES/0603-sd-event-use-usec_add.patch b/SOURCES/0603-sd-event-use-usec_add.patch new file mode 100644 index 0000000..c155350 --- /dev/null +++ b/SOURCES/0603-sd-event-use-usec_add.patch @@ -0,0 +1,27 @@ +From b79e00d8f97b8c959c5b17f0547c680f86dd9132 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Tue, 15 Jun 2021 01:01:48 +0900 +Subject: [PATCH] sd-event: use usec_add() + +(cherry picked from commit a595fb5ca9c69c589e758e9ebe3b70ac90450ba3) + +Related: #1968528 +--- + src/libsystemd/sd-event/sd-event.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c +index 6a20b658e4..f675c09d84 100644 +--- a/src/libsystemd/sd-event/sd-event.c ++++ b/src/libsystemd/sd-event/sd-event.c +@@ -3514,8 +3514,8 @@ static int arm_watchdog(sd_event *e) { + assert(e->watchdog_fd >= 0); + + t = sleep_between(e, +- e->watchdog_last + (e->watchdog_period / 2), +- e->watchdog_last + (e->watchdog_period * 3 / 4)); ++ usec_add(e->watchdog_last, (e->watchdog_period / 2)), ++ usec_add(e->watchdog_last, (e->watchdog_period * 3 / 4))); + + timespec_store(&its.it_value, t); + diff --git a/SOURCES/0604-sd-event-make-event_source_time_prioq_reshuffle-acce.patch b/SOURCES/0604-sd-event-make-event_source_time_prioq_reshuffle-acce.patch new file mode 100644 index 0000000..13ed16d --- /dev/null +++ b/SOURCES/0604-sd-event-make-event_source_time_prioq_reshuffle-acce.patch @@ -0,0 +1,40 @@ +From bf370d05bbc8c4d91c8c2b455116e59a24e48911 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Tue, 15 Jun 2021 02:03:02 +0900 +Subject: [PATCH] sd-event: make event_source_time_prioq_reshuffle() accept all + event source type + +But it does nothing for an event source which is neither a timer nor +ratelimited. + +(cherry picked from commit 5c08c7ab23dbf02aaf4e4bbae8e08a195da230a4) + +Related: #1968528 +--- + src/libsystemd/sd-event/sd-event.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c +index f675c09d84..ae46392901 100644 +--- a/src/libsystemd/sd-event/sd-event.c ++++ b/src/libsystemd/sd-event/sd-event.c +@@ -954,14 +954,15 @@ static void event_source_time_prioq_reshuffle(sd_event_source *s) { + assert(s); + + /* Called whenever the event source's timer ordering properties changed, i.e. time, accuracy, +- * pending, enable state. Makes sure the two prioq's are ordered properly again. */ ++ * pending, enable state, and ratelimiting state. Makes sure the two prioq's are ordered ++ * properly again. */ + + if (s->ratelimited) + d = &s->event->monotonic; +- else { +- assert(EVENT_SOURCE_IS_TIME(s->type)); ++ else if (EVENT_SOURCE_IS_TIME(s->type)) + assert_se(d = event_get_clock_data(s->event, s->type)); +- } ++ else ++ return; /* no-op for an event source which is neither a timer nor ratelimited. */ + + prioq_reshuffle(d->earliest, s, &s->earliest_index); + prioq_reshuffle(d->latest, s, &s->latest_index); diff --git a/SOURCES/0605-sd-event-always-reshuffle-time-prioq-on-changing-onl.patch b/SOURCES/0605-sd-event-always-reshuffle-time-prioq-on-changing-onl.patch new file mode 100644 index 0000000..23178cd --- /dev/null +++ b/SOURCES/0605-sd-event-always-reshuffle-time-prioq-on-changing-onl.patch @@ -0,0 +1,90 @@ +From 1ce5187fb47bec57de4d8d3fd0068072228ec5e3 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Tue, 15 Jun 2021 02:13:59 +0900 +Subject: [PATCH] sd-event: always reshuffle time prioq on changing + online/offline state + +Before 81107b8419c39f726fd2805517a5b9faab204e59, the compare functions +for the latest or earliest prioq did not handle ratelimited flag. +So, it was ok to not reshuffle the time prioq when changing the flag. + +But now, those two compare functions also compare the source is +ratelimited or not. So, it is necessary to reshuffle the time prioq +after changing the ratelimited flag. + +Hopefully fixes #19903. + +(cherry picked from commit 2115b9b6629eeba7bc9f42f757f38205febb1cb7) + +Related: #1968528 +--- + src/libsystemd/sd-event/sd-event.c | 33 ++++++++++-------------------- + 1 file changed, 11 insertions(+), 22 deletions(-) + +diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c +index ae46392901..f78da00c3a 100644 +--- a/src/libsystemd/sd-event/sd-event.c ++++ b/src/libsystemd/sd-event/sd-event.c +@@ -2390,14 +2390,6 @@ static int event_source_offline( + source_io_unregister(s); + break; + +- case SOURCE_TIME_REALTIME: +- case SOURCE_TIME_BOOTTIME: +- case SOURCE_TIME_MONOTONIC: +- case SOURCE_TIME_REALTIME_ALARM: +- case SOURCE_TIME_BOOTTIME_ALARM: +- event_source_time_prioq_reshuffle(s); +- break; +- + case SOURCE_SIGNAL: + event_gc_signal_data(s->event, &s->priority, s->signal.sig); + break; +@@ -2415,6 +2407,11 @@ static int event_source_offline( + prioq_reshuffle(s->event->exit, s, &s->exit.prioq_index); + break; + ++ case SOURCE_TIME_REALTIME: ++ case SOURCE_TIME_BOOTTIME: ++ case SOURCE_TIME_MONOTONIC: ++ case SOURCE_TIME_REALTIME_ALARM: ++ case SOURCE_TIME_BOOTTIME_ALARM: + case SOURCE_DEFER: + case SOURCE_POST: + case SOURCE_INOTIFY: +@@ -2424,6 +2421,9 @@ static int event_source_offline( + assert_not_reached("Wut? I shouldn't exist."); + } + ++ /* Always reshuffle time prioq, as the ratelimited flag may be changed. */ ++ event_source_time_prioq_reshuffle(s); ++ + return 1; + } + +@@ -2505,22 +2505,11 @@ static int event_source_online( + s->ratelimited = ratelimited; + + /* Non-failing operations below */ +- switch (s->type) { +- case SOURCE_TIME_REALTIME: +- case SOURCE_TIME_BOOTTIME: +- case SOURCE_TIME_MONOTONIC: +- case SOURCE_TIME_REALTIME_ALARM: +- case SOURCE_TIME_BOOTTIME_ALARM: +- event_source_time_prioq_reshuffle(s); +- break; +- +- case SOURCE_EXIT: ++ if (s->type == SOURCE_EXIT) + prioq_reshuffle(s->event->exit, s, &s->exit.prioq_index); +- break; + +- default: +- break; +- } ++ /* Always reshuffle time prioq, as the ratelimited flag may be changed. */ ++ event_source_time_prioq_reshuffle(s); + + return 1; + } diff --git a/SOURCES/0606-ci-run-unit-tests-on-z-stream-branches-as-well.patch b/SOURCES/0606-ci-run-unit-tests-on-z-stream-branches-as-well.patch new file mode 100644 index 0000000..91d1c80 --- /dev/null +++ b/SOURCES/0606-ci-run-unit-tests-on-z-stream-branches-as-well.patch @@ -0,0 +1,27 @@ +From 68cedfd41f1ea3eda34b0023e951649b92953709 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Thu, 15 Jul 2021 12:27:33 +0200 +Subject: [PATCH] ci: run unit tests on z-stream branches as well + +Resolves: #1970860 +rhel-only +--- + .github/workflows/unit_tests.yml | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml +index 15f5127a75..428bde4ed8 100644 +--- a/.github/workflows/unit_tests.yml ++++ b/.github/workflows/unit_tests.yml +@@ -2,10 +2,7 @@ + # vi: ts=2 sw=2 et: + # + name: Unit tests +-on: +- pull_request: +- branches: +- - master ++on: [pull_request] + + jobs: + build: diff --git a/SOURCES/0607-ci-drop-forgotten-Travis-references.patch b/SOURCES/0607-ci-drop-forgotten-Travis-references.patch new file mode 100644 index 0000000..4537e2e --- /dev/null +++ b/SOURCES/0607-ci-drop-forgotten-Travis-references.patch @@ -0,0 +1,32 @@ +From 9bb57b7bed93e79f578e7c5b0c95f1f454e5d829 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Wed, 3 Mar 2021 12:33:38 +0100 +Subject: [PATCH] ci: drop forgotten Travis references + +rhel-only +Related: #1934504 +--- + .github/workflows/unit_tests.sh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh +index ea4f7e7592..43882b27da 100755 +--- a/.github/workflows/unit_tests.sh ++++ b/.github/workflows/unit_tests.sh +@@ -68,7 +68,7 @@ for phase in "${PHASES[@]}"; do + case $phase in + SETUP) + info "Setup phase" +- info "Using Travis $CENTOS_RELEASE" ++ info "Using $CENTOS_RELEASE image" + # Pull a Docker image and start a new container + docker pull quay.io/centos/centos:$CENTOS_RELEASE + info "Starting container $CONT_NAME" +@@ -110,7 +110,6 @@ for phase in "${PHASES[@]}"; do + docker exec --interactive=false \ + -e UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 \ + -e ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 \ +- -e "TRAVIS=$TRAVIS" \ + -t $CONT_NAME \ + meson test --timeout-multiplier=3 -C ./build/ --print-errorlogs + ;; diff --git a/SOURCES/0608-ci-run-unit-tests-on-CentOS-8-Stream-as-well.patch b/SOURCES/0608-ci-run-unit-tests-on-CentOS-8-Stream-as-well.patch new file mode 100644 index 0000000..159399a --- /dev/null +++ b/SOURCES/0608-ci-run-unit-tests-on-CentOS-8-Stream-as-well.patch @@ -0,0 +1,113 @@ +From ccde55a339d211af488b1f1c148597d7977a9bb8 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Wed, 3 Mar 2021 12:49:20 +0100 +Subject: [PATCH] ci: run unit tests on CentOS 8 Stream as well + +rhel-only +Related: #1934504 +--- + .github/workflows/unit_tests.sh | 52 +++++++++++++++++++++++++++++++- + .github/workflows/unit_tests.yml | 13 ++++---- + 2 files changed, 58 insertions(+), 7 deletions(-) + +diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh +index 43882b27da..8648e7149e 100755 +--- a/.github/workflows/unit_tests.sh ++++ b/.github/workflows/unit_tests.sh +@@ -58,6 +58,53 @@ CONFIGURE_OPTS=( + -Ddefault-hierarchy=legacy + ) + ++# CentOS 8 Stream still doesn't provide SRPMs, so we can't use dnf's builddep ++# command to fetch this list for us. Hopefully, we'll be able to get rid ++# of this in the future. ++# See: https://bugs.centos.org/view.php?id=16715 ++SYSTEMD_BUILD_DEPS=( ++ audit-libs-devel ++ bzip2-devel ++ cryptsetup-devel ++ dbus-devel ++ docbook-style-xsl ++ elfutils-devel ++ firewalld-filesystem ++ gcc ++ gcc-c++ ++ gettext ++ git ++ gnu-efi ++ gnu-efi-devel ++ gnutls-devel ++ gobject-introspection-devel ++ gperf ++ iptables-devel ++ kmod-devel ++ libacl-devel ++ libblkid-devel ++ libcap-devel ++ libcurl-devel ++ libgcrypt-devel ++ libgpg-error-devel ++ libidn2-devel ++ libmicrohttpd-devel ++ libmount-devel ++ libseccomp-devel ++ libselinux-devel ++ libxkbcommon-devel ++ libxslt ++ lz4 ++ lz4-devel ++ meson ++ pam-devel ++ pkgconf-pkg-config ++ python3-lxml ++ python36-devel ++ tree ++ xz-devel ++) ++ + function info() { + echo -e "\033[33;1m$1\033[0m" + } +@@ -85,7 +132,10 @@ for phase in "${PHASES[@]}"; do + # Upgrade the container to get the most recent environment + $DOCKER_EXEC dnf -y upgrade + # Install systemd's build dependencies +- $DOCKER_EXEC dnf -q -y --enablerepo "powertools" builddep systemd ++ if ! $DOCKER_EXEC dnf -q -y --enablerepo "powertools" builddep systemd; then ++ # See the $SYSTEMD_BUILD_DEPS above for reasoning ++ $DOCKER_EXEC dnf -q -y --enablerepo "powertools" install "${SYSTEMD_BUILD_DEPS[@]}" ++ fi + ;; + RUN|RUN_GCC) + info "Run phase" +diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml +index 428bde4ed8..b363118be8 100644 +--- a/.github/workflows/unit_tests.yml ++++ b/.github/workflows/unit_tests.yml +@@ -7,19 +7,20 @@ on: [pull_request] + jobs: + build: + runs-on: ubuntu-20.04 +- env: +- CENTOS_RELEASE: "centos8" +- CONT_NAME: "systemd-centos8-ci" + strategy: + fail-fast: false + matrix: +- run_phase: [GCC, GCC_ASAN] ++ image: [centos8, stream8] ++ phase: [GCC, GCC_ASAN] ++ env: ++ CONT_NAME: "systemd-centos8-ci" ++ CENTOS_RELEASE: ${{ matrix.image }} + steps: + - name: Repository checkout + uses: actions/checkout@v1 + - name: Install build dependencies + run: sudo -E .github/workflows/unit_tests.sh SETUP +- - name: Build & test (${{ matrix.run_phase }}) +- run: sudo -E .github/workflows/unit_tests.sh RUN_${{ matrix.run_phase }} ++ - name: Build & test (${{ env.CENTOS_RELEASE }} / ${{ matrix.phase }}) ++ run: sudo -E .github/workflows/unit_tests.sh RUN_${{ matrix.phase }} + - name: Cleanup + run: sudo -E .github/workflows/unit_tests.sh CLEANUP diff --git a/SOURCES/0609-ci-add-missing-test-dependencies.patch b/SOURCES/0609-ci-add-missing-test-dependencies.patch new file mode 100644 index 0000000..86c6c62 --- /dev/null +++ b/SOURCES/0609-ci-add-missing-test-dependencies.patch @@ -0,0 +1,37 @@ +From 68555d26da9e46efbd70703b39a81cee601d265a Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Wed, 3 Mar 2021 13:14:02 +0100 +Subject: [PATCH] ci: add missing test dependencies + +rhel-only +Related: #1934504 +--- + .github/workflows/unit_tests.sh | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh +index 8648e7149e..ad4584ec1d 100755 +--- a/.github/workflows/unit_tests.sh ++++ b/.github/workflows/unit_tests.sh +@@ -6,7 +6,20 @@ CONT_NAME="${CONT_NAME:-centos-$CENTOS_RELEASE-$RANDOM}" + DOCKER_EXEC="${DOCKER_EXEC:-docker exec $CONT_NAME}" + DOCKER_RUN="${DOCKER_RUN:-docker run}" + REPO_ROOT="${REPO_ROOT:-$PWD}" +-ADDITIONAL_DEPS=(libasan libubsan net-tools strace nc e2fsprogs quota dnsmasq diffutils) ++ADDITIONAL_DEPS=( ++ diffutils ++ dnsmasq ++ e2fsprogs ++ hostname ++ libasan ++ libubsan ++ nc ++ net-tools ++ perl-IPC-SysV ++ perl-Time-HiRes ++ quota ++ strace ++) + # RHEL8 options + CONFIGURE_OPTS=( + -Dsysvinit-path=/etc/rc.d/init.d diff --git a/SOURCES/0610-meson-bump-timeout-for-test-udev-to-180s.patch b/SOURCES/0610-meson-bump-timeout-for-test-udev-to-180s.patch new file mode 100644 index 0000000..f750215 --- /dev/null +++ b/SOURCES/0610-meson-bump-timeout-for-test-udev-to-180s.patch @@ -0,0 +1,30 @@ +From 998041fbb2b4114f2f1df604cdebc4afbf682d63 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Fri, 18 Jan 2019 22:32:42 +0100 +Subject: [PATCH] meson: bump timeout for test-udev to 180s + +On some (mainly virtual) machines the last test takes more than 30 +seconds, which causes unnecessary fails, as the test itself is working +properly. + +(cherry picked from commit bb0e960448fce037f5b82b1829863da8ccbe636b) + +Related: #1934504 +--- + test/meson.build | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/test/meson.build b/test/meson.build +index 52e4fa2e3c..535354f3ab 100644 +--- a/test/meson.build ++++ b/test/meson.build +@@ -246,7 +246,8 @@ custom_target( + if perl.found() + udev_test_pl = find_program('udev-test.pl') + test('udev-test', +- udev_test_pl) ++ udev_test_pl, ++ timeout : 180) + else + message('Skipping udev-test because perl is not available') + endif diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 44ae8e9..b0a2787 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -13,7 +13,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 239 -Release: 48%{?dist} +Release: 49%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: System and Service Manager @@ -647,6 +647,19 @@ Patch0594: 0594-core-Detect-initial-timer-state-from-serialized-data.patch Patch0595: 0595-rc-local-order-after-network-online.target.patch Patch0596: 0596-set-core-ulimit-to-0-like-on-RHEL-7.patch Patch0597: 0597-test-mountpointutil-util-do-not-assert-in-test_mnt_i.patch +Patch0598: 0598-remove-a-left-over-break.patch +Patch0599: 0599-basic-unit-name-do-not-use-strdupa-on-a-path.patch +Patch0600: 0600-sd-event-change-ordering-of-pending-ratelimited-even.patch +Patch0601: 0601-sd-event-drop-unnecessary-else.patch +Patch0602: 0602-sd-event-use-CMP-macro.patch +Patch0603: 0603-sd-event-use-usec_add.patch +Patch0604: 0604-sd-event-make-event_source_time_prioq_reshuffle-acce.patch +Patch0605: 0605-sd-event-always-reshuffle-time-prioq-on-changing-onl.patch +Patch0606: 0606-ci-run-unit-tests-on-z-stream-branches-as-well.patch +Patch0607: 0607-ci-drop-forgotten-Travis-references.patch +Patch0608: 0608-ci-run-unit-tests-on-CentOS-8-Stream-as-well.patch +Patch0609: 0609-ci-add-missing-test-dependencies.patch +Patch0610: 0610-meson-bump-timeout-for-test-udev-to-180s.patch %ifarch %{ix86} x86_64 aarch64 @@ -1274,6 +1287,21 @@ fi %files tests -f .file-list-tests %changelog +* Fri Jul 23 2021 systemd maintenance team - 239-49 +- remove a left-over break (#1970860) +- basic/unit-name: do not use strdupa() on a path (#1974700) +- sd-event: change ordering of pending/ratelimited events (#1968528) +- sd-event: drop unnecessary "else" (#1968528) +- sd-event: use CMP() macro (#1968528) +- sd-event: use usec_add() (#1968528) +- sd-event: make event_source_time_prioq_reshuffle() accept all event source type (#1968528) +- sd-event: always reshuffle time prioq on changing online/offline state (#1968528) +- ci: run unit tests on z-stream branches as well (#1970860) +- ci: drop forgotten Travis references (#1934504) +- ci: run unit tests on CentOS 8 Stream as well (#1934504) +- ci: add missing test dependencies (#1934504) +- meson: bump timeout for test-udev to 180s (#1934504) + * Thu Jun 24 2021 systemd maintenance team - 239-48 - cgroup: Also set io.bfq.weight (#1927290) - seccomp: allow turning off of seccomp filtering via env var (#1916835)