diff --git a/0038-check-cgroup-path-empty-while-setting-freezer.patch b/0038-check-cgroup-path-empty-while-setting-freezer.patch new file mode 100644 index 0000000000000000000000000000000000000000..696d38b97d28a8b2d1fe54cf793f5c6effe5b3dd --- /dev/null +++ b/0038-check-cgroup-path-empty-while-setting-freezer.patch @@ -0,0 +1,34 @@ +From 6085c67cce5d4c5495e9a585d137b79af1b1598e Mon Sep 17 00:00:00 2001 +From: jikai +Date: Tue, 19 Dec 2023 15:41:05 +0800 +Subject: [PATCH] check cgroup path empty while setting freezer + +Signed-off-by: jikai +--- + src/lxc/start.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/lxc/start.c b/src/lxc/start.c +index ec64546..c01eb9b 100644 +--- a/src/lxc/start.c ++++ b/src/lxc/start.c +@@ -1020,9 +1020,15 @@ static int get_all_pids(struct cgroup_ops *cg_ops, pid_t **pids, size_t *len) + static int set_cgroup_freezer(struct cgroup_ops *cg_ops, const char *value) + { + char *fullpath; ++ const char *cgroup_path; + int ret; + +- fullpath = must_make_path(cg_ops->get_cgroup_full_path(cg_ops, "freezer"), "freezer.state", NULL); ++ cgroup_path = cg_ops->get_cgroup_full_path(cg_ops, "freezer"); ++ if (cgroup_path == NULL) { ++ return -1; ++ } ++ ++ fullpath = must_make_path(cgroup_path, "freezer.state", NULL); + ret = lxc_write_to_file(fullpath, value, strlen(value), false, 0666); + free(fullpath); + return ret; +-- +2.33.0 + diff --git a/lxc.spec b/lxc.spec index c5bd21682140ae27cddf73f80b0badc98c547d2d..c3492046856179777bfeef3ed406d1775b405b52 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022102424 +%global _release 2022102425 Name: lxc Version: 4.0.3 @@ -45,6 +45,7 @@ Patch0034: 0034-add-secure-compile-macro.patch Patch0035: 0035-codecheck-fix.patch Patch0036: 0036-containers-in-the-FREEZING-state-also-need-to-be-unf.patch Patch0037: 0037-Add-succeed-message-info-for-ocihook.patch +Patch0038: 0038-check-cgroup-path-empty-while-setting-freezer.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -231,6 +232,12 @@ rm -rf %{buildroot}%{_sysconfdir}/default/%{name} %endif %changelog +* Tue Dec 19 2023 jikai - 4.0.3-2022102425 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: check cgroup path empty while setting freezer + * Tue Nov 7 2023 jikai - 4.0.3-2022102424 - Type:enhancement - ID:NA