From ddbad43fd0b4898229894aa1f001d530c6280827 Mon Sep 17 00:00:00 2001 From: basebuilder_pel7ppc64lebuilder0 Date: Mon, 10 Feb 2020 10:36:07 +0100 Subject: [PATCH] systemd update Signed-off-by: basebuilder_pel7ppc64lebuilder0 --- ...al-use-of-cgroup_path-after-free-whe.patch | 39 +++++++++++++++++++ SPECS/systemd.spec | 6 ++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0760-unit-fix-potential-use-of-cgroup_path-after-free-whe.patch diff --git a/SOURCES/0760-unit-fix-potential-use-of-cgroup_path-after-free-whe.patch b/SOURCES/0760-unit-fix-potential-use-of-cgroup_path-after-free-whe.patch new file mode 100644 index 00000000..2399b353 --- /dev/null +++ b/SOURCES/0760-unit-fix-potential-use-of-cgroup_path-after-free-whe.patch @@ -0,0 +1,39 @@ +From 97c5fed4ddbd627c046fbf946474270182bdda6e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Renaud=20M=C3=A9trich?= +Date: Sat, 23 Nov 2019 13:37:02 +0100 +Subject: [PATCH] unit: fix potential use of cgroup_path after free() when + freeing unit + +Resolves: #1778083 +--- + src/core/cgroup.c | 3 +-- + src/core/unit.c | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/core/cgroup.c b/src/core/cgroup.c +index 0779fa5552..f598fdd1e7 100644 +--- a/src/core/cgroup.c ++++ b/src/core/cgroup.c +@@ -873,8 +873,7 @@ void unit_destroy_cgroup_if_empty(Unit *u) { + + hashmap_remove(u->manager->cgroup_unit, u->cgroup_path); + +- free(u->cgroup_path); +- u->cgroup_path = NULL; ++ u->cgroup_path = mfree(u->cgroup_path); + u->cgroup_realized = false; + u->cgroup_realized_mask = 0; + } +diff --git a/src/core/unit.c b/src/core/unit.c +index def36a0930..cabbf8056e 100644 +--- a/src/core/unit.c ++++ b/src/core/unit.c +@@ -514,7 +514,7 @@ void unit_free(Unit *u) { + + if (u->cgroup_path) { + hashmap_remove(u->manager->cgroup_unit, u->cgroup_path); +- free(u->cgroup_path); ++ u->cgroup_path = mfree(u->cgroup_path); + } + + set_remove(u->manager->failed_units, u); diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 2a52477e..303990e8 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -8,7 +8,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 219 -Release: 67%{?dist} +Release: 68%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -799,6 +799,7 @@ Patch0756: 0756-pid1-properly-remove-references-to-the-unit-from-gc-.patch Patch0757: 0757-service-relax-PID-file-symlink-chain-checks-a-bit-81.patch Patch0758: 0758-path-util-fix-more-path_is_mount-e792e890f-fallout.patch Patch0759: 0759-core-exclude-.slice-units-from-systemctl-isolate.patch +Patch0760: 0760-unit-fix-potential-use-of-cgroup_path-after-free-whe.patch Patch9999: 9999-Update-kernel-install-script-by-backporting-fedora-p.patch @@ -1777,6 +1778,9 @@ fi %{_mandir}/man8/systemd-resolved.* %changelog +* Fri Nov 29 2019 Lukas Nykryn - 219-67.3 +- unit: fix potential use of cgroup_path after free() when freeing unit (#1778083) + * Thu Sep 19 2019 David Tardon - 219-67.2 - core: exclude .slice units from "systemctl isolate" (#1751130)