From 5dafdec341f5ed2781605fe7ec0c3160af9d74cb Mon Sep 17 00:00:00 2001 From: Linux_zhang Date: Wed, 3 Sep 2025 11:17:55 +0800 Subject: [PATCH] sync patch from systemd community (cherry picked from commit 851036999a00b31406c919f296aa0d49d752a821) --- backport-systemctl-fix-memleak.patch | 43 ++++++++++++++++++++++++++++ systemd.spec | 7 ++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 backport-systemctl-fix-memleak.patch diff --git a/backport-systemctl-fix-memleak.patch b/backport-systemctl-fix-memleak.patch new file mode 100644 index 00000000..aee94a61 --- /dev/null +++ b/backport-systemctl-fix-memleak.patch @@ -0,0 +1,43 @@ +From e820e232210376b0a1f9d3a562395beab9206ed8 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Mon, 27 Jan 2025 04:17:27 +0900 +Subject: [PATCH] systemctl: fix memleak + +Fixes a bug introduced by adb6cd9be2b7e9e614d2b5835c7b70cf8eacc852. + +Fixes #36178. + +(cherry picked from commit 08570f284140752b9f0aad4dbcdff32c090a3661) +(cherry picked from commit 0240c4ac435ed8db413d83474dd8524e655dfb94) +(cherry picked from commit 6a1b9afc077c9a526fe0419f22afb4794b5a35e4) +--- + src/systemctl/systemctl-is-system-running.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/systemctl/systemctl-is-system-running.c b/src/systemctl/systemctl-is-system-running.c +index 59be6a7a7e..8d5303c2d8 100644 +--- a/src/systemctl/systemctl-is-system-running.c ++++ b/src/systemctl/systemctl-is-system-running.c +@@ -66,6 +66,10 @@ int verb_is_system_running(int argc, char *argv[], void *userdata) { + } + + if (arg_wait && STR_IN_SET(state, "initializing", "starting")) { ++ /* The signal handler will allocate memory and assign to 'state', hence need to free previous ++ * one before entering the event loop. */ ++ state = mfree(state); ++ + r = sd_event_loop(event); + if (r < 0) { + log_warning_errno(r, "Failed to get property from event loop: %m"); +@@ -73,6 +77,8 @@ int verb_is_system_running(int argc, char *argv[], void *userdata) { + puts("unknown"); + return EXIT_FAILURE; + } ++ ++ assert(state); + } + + if (!arg_quiet) +-- +2.43.0 + diff --git a/systemd.spec b/systemd.spec index d8ca635c..ba89126c 100644 --- a/systemd.spec +++ b/systemd.spec @@ -27,7 +27,7 @@ Name: systemd Url: https://systemd.io/ Version: 255 -Release: 50 +Release: 51 License: LGPL-2.1-or-later AND MIT AND GPL-2.0-or-later Summary: System and Service Manager @@ -125,6 +125,8 @@ Patch6665: backport-core-service-don-t-setup-credentials-for-ExecConditi.pa Patch6666: backport-core-service-allow-ExecStartPost-cmds-to-access-cred.patch Patch6667: backport-core-introduce-exec_params_need_credentials.patch Patch6668: backport-core-reuse-credential-dir-across-start-and-start-pos.patch +#fix ISSUE[#ICVCYY] +Patch6669: backport-systemctl-fix-memleak.patch Patch9008: update-rtc-with-system-clock-when-shutdown.patch Patch9009: udev-add-actions-while-rename-netif-failed.patch @@ -1727,6 +1729,9 @@ fi %{_unitdir}/veritysetup.target %changelog +* Wed Sep 03 2025 Linux_zhang - 255-51 +- sync patch from systemd community + * Fri Aug 08 2025 Funda Wang - 255-50 - utmp group is required in file list, it must be created in pre section -- Gitee