diff --git a/0350-fuzz-journal-remote-use-ASSERT_OK-and-friends.patch b/0350-fuzz-journal-remote-use-ASSERT_OK-and-friends.patch new file mode 100644 index 0000000..be2874f --- /dev/null +++ b/0350-fuzz-journal-remote-use-ASSERT_OK-and-friends.patch @@ -0,0 +1,55 @@ +From 19eadc77d4b941ae8918fca88a44ecd0876537ff Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Sat, 28 Dec 2024 14:17:47 +0900 +Subject: [PATCH] fuzz-journal-remote: use ASSERT_OK() and friends + +(cherry picked from commit 27c992dd9fa7f69779adc85607523a1e52296af0) + +Related: RHEL-79976 +--- + src/journal-remote/fuzz-journal-remote.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/src/journal-remote/fuzz-journal-remote.c b/src/journal-remote/fuzz-journal-remote.c +index 774389dee3..2427c739b8 100644 +--- a/src/journal-remote/fuzz-journal-remote.c ++++ b/src/journal-remote/fuzz-journal-remote.c +@@ -16,6 +16,7 @@ + #include "path-util.h" + #include "rm-rf.h" + #include "strv.h" ++#include "tests.h" + #include "tmpfile-util.h" + + int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { +@@ -54,14 +55,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + return r; + } + +- r = journal_remote_add_source(&s, fdin, (char*) "fuzz-data", false); +- if (r < 0) +- return r; ++ ASSERT_OK_POSITIVE(journal_remote_add_source(&s, fdin, (char*) "fuzz-data", false)); + TAKE_FD(fdin_close); +- assert(r > 0); + + while (s.active) +- assert_se(journal_remote_handle_raw_source(NULL, fdin, 0, &s) >= 0); ++ ASSERT_OK(journal_remote_handle_raw_source(NULL, fdin, 0, &s)); + + assert_se(close(fdin) < 0 && errno == EBADF); /* Check that the fd is closed already */ + +@@ -84,11 +82,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + for (OutputMode mode = 0; mode < _OUTPUT_MODE_MAX; mode++) { + if (!dev_null) + log_info("/* %s */", output_mode_to_string(mode)); +- r = show_journal(dev_null ?: stdout, j, mode, 0, 0, -1, 0, NULL); +- assert_se(r >= 0); +- +- r = sd_journal_seek_head(j); +- assert_se(r >= 0); ++ ASSERT_OK(show_journal(dev_null ?: stdout, j, mode, 0, 0, -1, 0, NULL)); ++ ASSERT_OK(sd_journal_seek_head(j)); + } + + return 0; diff --git a/0351-logs-show-skip-journal-entry-with-an-invalid-timesta.patch b/0351-logs-show-skip-journal-entry-with-an-invalid-timesta.patch new file mode 100644 index 0000000..a36ce28 --- /dev/null +++ b/0351-logs-show-skip-journal-entry-with-an-invalid-timesta.patch @@ -0,0 +1,76 @@ +From 93fa6d7512c97c87ae9023c3f4a7825865c70c1a Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Sat, 28 Dec 2024 14:09:22 +0900 +Subject: [PATCH] logs-show: skip journal entry with an invalid timestamp + +Follow-up for 275e6be052e690adcad5d2a557acb9dcb5bedbc6. +Fixes oss-fuzz#385221809 (https://issues.oss-fuzz.com/issues/385221809). +Fixes #35737. + +(cherry picked from commit f19f640513cf3ededdf1f5cc6f00efca27efc61f) + +Related: RHEL-79976 +--- + src/shared/logs-show.c | 9 +++++---- + .../fuzz/fuzz-journal-remote/oss-fuzz-385221809 | Bin 0 -> 10595 bytes + 2 files changed, 5 insertions(+), 4 deletions(-) + create mode 100644 test/fuzz/fuzz-journal-remote/oss-fuzz-385221809 + +diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c +index 2289b83a15..3f3f4e628d 100644 +--- a/src/shared/logs-show.c ++++ b/src/shared/logs-show.c +@@ -335,7 +335,7 @@ static int output_timestamp_monotonic( + assert(previous_boot_id); + + if (!VALID_MONOTONIC(display_ts->monotonic)) +- return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No valid monotonic timestamp available"); ++ return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "No valid monotonic timestamp available, skipping showing journal entry."); + + written_chars += fprintf(f, "[%5"PRI_USEC".%06"PRI_USEC, display_ts->monotonic / USEC_PER_SEC, display_ts->monotonic % USEC_PER_SEC); + +@@ -375,15 +375,14 @@ static int output_timestamp_realtime( + assert(j); + + if (!VALID_REALTIME(usec)) +- return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No valid realtime timestamp available."); ++ return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "No valid realtime timestamp available, skipping showing journal entry."); + + switch (mode) { + + case OUTPUT_SHORT_FULL: + case OUTPUT_WITH_UNIT: { + if (!format_timestamp_style(buf, sizeof(buf), usec, flags & OUTPUT_UTC ? TIMESTAMP_UTC : TIMESTAMP_PRETTY)) +- return log_error_errno(SYNTHETIC_ERRNO(EINVAL), +- "Failed to format timestamp: %" PRIu64, usec); ++ return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to format timestamp (%"PRIu64"), skipping showing journal entry.", usec); + break; + } + +@@ -623,6 +622,8 @@ static int output_short( + parse_display_realtime(j, realtime, monotonic, &usec); + r = output_timestamp_realtime(f, j, mode, flags, usec); + } ++ if (r == -EINVAL) ++ return 0; + if (r < 0) + return r; + n += r; +diff --git a/test/fuzz/fuzz-journal-remote/oss-fuzz-385221809 b/test/fuzz/fuzz-journal-remote/oss-fuzz-385221809 +new file mode 100644 +index 0000000000000000000000000000000000000000..8bb473ac56adb97962da8894c0ca5bf70cd8c437 +GIT binary patch +literal 10595 +zcmeI2zfQw25XLk60eFs!ojCRop;97Li8NIbkU*6zkjTW$2&`FnhQ0s`6JlWGJ^Cgn +zZD{@wk`$$=3HKX3Sf}%McebaGDCIk&({SQCDp`VXk3^^ +z!Gs0EB;>=^H0@E-h*GXM^+Int8Rvc`#(@e;TA&Ngr6scq288spZOD)~A5t+$6>%KL +zRr?5nAcJB#sA~GgL*E2%!Q~dQ2!bF8f*=TjAP9o&KL`6Sv19H#&W9j-M!kzCv8e3c +zCe+3(lX(Q%7?0Xy{IcKt=ym!J#W(u6^o;?e-1ozx-7Fo@MIobK;Y+KW +z2UK~~^1;Qd)sl-%*oEYxiju`9*AHkL*g9iJfd+YbOCMFeMuSR2a?7A!ud8ud-Ivd^ +dD@#q2klLoMFU$LDPN(B2f4O){t%_?e +Date: Mon, 14 Apr 2025 13:49:51 +0200 +Subject: [PATCH] man: mention that rhel-9.0 net naming scheme is the same as + v251 + +Due to the rebase in 9.2 it is a bit confusing that we are documenting +the newer upstream scheme and it might look 9.0 is based in v255. +So let's explicitly mention that the scheme is the same as in v251. + +Resolves: RHEL-87179 + +rhel-only: doc +--- + man/systemd.net-naming-scheme.xml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml +index 0b0bbbb2f1..d2dc5fe7bb 100644 +--- a/man/systemd.net-naming-scheme.xml ++++ b/man/systemd.net-naming-scheme.xml +@@ -568,7 +568,8 @@ + + rhel-9.0 + +- Since version v247 we no longer set ++ Same as naming scheme v251. ++ Since version v247 we no longer set + ID_NET_NAME_SLOT if we detect that a PCI device associated with a slot is a PCI + bridge as that would create naming conflict when there are more child devices on that bridge. Now, + this is relaxed and we will use slot information to generate the name based on it but only if diff --git a/0353-backlight-Drop-support-for-actual_brightness.patch b/0353-backlight-Drop-support-for-actual_brightness.patch new file mode 100644 index 0000000..f9a7e56 --- /dev/null +++ b/0353-backlight-Drop-support-for-actual_brightness.patch @@ -0,0 +1,80 @@ +From 1df2bb0f638dcb518575ae67dcd809670ed52639 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Fri, 28 Mar 2025 09:19:23 -0500 +Subject: [PATCH] backlight: Drop support for actual_brightness + +Some AMD systems have support for features like custom brightness +curve or adaptive backlight management. These features allow the +display driver to adjust the brightness based upon other factors +than just the user brightness request. + +The user's brightness request is indicated in the 'brightness' file +but the effective result of the logic in the display driver is stored +in the 'actual_brightness' file. + +This leads to problems when shutting the system down because the value +of 'actual_brightness' may be lower than 'brightness' and the wrong value +gets stored for the next boot. + +For example if the brightness a user requested was 150, the actual_brightness +might be 130. So the next boot the brightness will be "set" to 130, but the +actual brightness might be 115. If the user reboots again it will be set to 115 +for the next boot but the actual brightness might be 100. That is this gets worse +and worse each reboot cycle until the system eventually boots up at minimum +brightness. + +Furthermore the kernel documentation indicates that the brightness and +actual_brightness files are not guaranteed to be the same values. + +Due to this; drop the use of 'actual_brightness' when saving/restoring brightness +and instead rely only upon 'brightness'. + +Signed-off-by: Mario Limonciello + +(cherry picked from commit 9a224c307b36610e3675390eb2620e74d0f4efb0) + +Resolves: RHEL-86713 +--- + src/backlight/backlight.c | 29 ----------------------------- + 1 file changed, 29 deletions(-) + +diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c +index 2de6c2008a..018cd35321 100644 +--- a/src/backlight/backlight.c ++++ b/src/backlight/backlight.c +@@ -408,35 +408,6 @@ static int read_brightness(sd_device *device, unsigned max_brightness, unsigned + assert(device); + assert(ret_brightness); + +- if (device_in_subsystem(device, "backlight")) { +- r = sd_device_get_sysattr_value(device, "actual_brightness", &value); +- if (r == -ENOENT) { +- log_device_debug_errno(device, r, "Failed to read 'actual_brightness' attribute, " +- "fall back to use 'brightness' attribute: %m"); +- goto use_brightness; +- } +- if (r < 0) +- return log_device_debug_errno(device, r, "Failed to read 'actual_brightness' attribute: %m"); +- +- r = safe_atou(value, &brightness); +- if (r < 0) { +- log_device_debug_errno(device, r, "Failed to parse 'actual_brightness' attribute, " +- "fall back to use 'brightness' attribute: %s", value); +- goto use_brightness; +- } +- +- if (brightness > max_brightness) { +- log_device_debug(device, "actual_brightness=%u is larger than max_brightness=%u, " +- "fall back to use 'brightness' attribute", brightness, max_brightness); +- goto use_brightness; +- } +- +- log_device_debug(device, "Current actual_brightness is %u", brightness); +- *ret_brightness = brightness; +- return 0; +- } +- +-use_brightness: + r = sd_device_get_sysattr_value(device, "brightness", &value); + if (r < 0) + return log_device_debug_errno(device, r, "Failed to read 'brightness' attribute: %m"); diff --git a/split-files.py b/split-files.py index 8f7079f..fd9b7e2 100644 --- a/split-files.py +++ b/split-files.py @@ -68,6 +68,7 @@ outputs = {suffix: open(f'.file-list-{suffix}', 'w') 'devel', 'container', 'oomd', + 'tests', 'remote', 'resolve', 'main', @@ -101,6 +102,8 @@ for file in files(buildroot): o = outputs['pam'] elif '/rpm/' in n: o = outputs['rpm-macros'] + elif '/usr/lib/systemd/tests' in n: + o = outputs['tests'] elif 'ukify' in n: o = outputs['ukify'] elif re.search(r'/libsystemd-(shared|core)-.*\.so$', n): diff --git a/systemd.spec b/systemd.spec index a7dadf2..99984c3 100644 --- a/systemd.spec +++ b/systemd.spec @@ -48,7 +48,7 @@ Url: https://systemd.io # Allow users to specify the version and release when building the rpm by # setting the %%version_override and %%release_override macros. Version: %{?version_override}%{!?version_override:257} -Release: 10%{?dist}.alma.1 +Release: 11%{?dist}.alma.1 %global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?) @@ -459,6 +459,10 @@ Patch0346: 0346-bash-completion-udevadm-verify-suggest-found-udev-ru.patch Patch0347: 0347-udevadm-introduce-cat-command.patch Patch0348: 0348-resolved-pick-up-new-DNSSEC-KSC-from-2024.patch Patch0349: 0349-test_ukify-Skip-on-riscv64.patch +Patch0350: 0350-fuzz-journal-remote-use-ASSERT_OK-and-friends.patch +Patch0351: 0351-logs-show-skip-journal-entry-with-an-invalid-timesta.patch +Patch0352: 0352-man-mention-that-rhel-9.0-net-naming-scheme-is-the-s.patch +Patch0353: 0353-backlight-Drop-support-for-actual_brightness.patch # Downstream-only patches (9000–9999) %endif @@ -792,7 +796,9 @@ Requires: (systemd-boot if %{shrink:( Requires: python3dist(pefile) Requires: python3dist(zstd) Requires: python3dist(cryptography) +%if %{undefined rhel} Recommends: python3dist(pillow) +%endif # for tests BuildRequires: binutils @@ -890,6 +896,20 @@ systemd-oomd is a system service that uses cgroups-v2 and pressure stall information (PSI) to monitor and take action on processes before an OOM occurs in kernel space. +%package tests +Summary: Internal unit tests for systemd +Requires: %{name}%{_isa} = %{version}-%{release} +# This dependency is provided transitively. Also add it explicitly to +# appease rpminspect, https://github.com/rpminspect/rpminspect/issues/1231: +Requires: %{name}-libs%{_isa} = %{version}-%{release} +Requires: python3dist(psutil) + +License: LGPL-2.1-or-later + +%description tests +"Installed tests" that are usually run as part of the build system. They can be +useful to test systemd internals. + %prep %autosetup -S git @@ -948,7 +968,7 @@ CONFIGURE_OPTS=( -Dfirst-boot-full-preset=true -Ddefault-network=true -Dtests=unsafe - -Dinstall-tests=false + -Dinstall-tests=true -Dnobody-user=nobody -Dnobody-group=nobody -Dcompat-mutable-uid-boundaries=true @@ -1380,6 +1400,8 @@ getent passwd systemd-oom &>/dev/null || useradd -r -l -g systemd-oom -d / -s /s %files oomd -f .file-list-oomd +%files tests -f .file-list-tests + %clean rm -rf $RPM_BUILD_ROOT rm -f 10-timeout-abort.conf.user @@ -1387,9 +1409,15 @@ rm -f .file-list-* rm -f %{name}.lang %changelog -* Sat Apr 12 2025 Andrew Lukoshko - 257-10.alma.1 +* Thu Apr 17 2025 Andrew Lukoshko - 257-11.alma.1 - Debrand for AlmaLinux +* Tue Apr 15 2025 systemd maintenance team - 257-11 +- fuzz-journal-remote: use ASSERT_OK() and friends (RHEL-79976) +- logs-show: skip journal entry with an invalid timestamp (RHEL-79976) +- man: mention that rhel-9.0 net naming scheme is the same as v251 (RHEL-87179) +- backlight: Drop support for actual_brightness (RHEL-86713) + * Fri Apr 11 2025 systemd maintenance team - 257-10 - resolved: pick up new DNSSEC KSC from 2024 (RHEL-77718) - test_ukify: Skip on riscv64 (RHEL-85854)