From 9272f22767fa9f8fd1457549abc66894bc07c951 Mon Sep 17 00:00:00 2001 From: "Neil.wrz" Date: Tue, 21 Feb 2023 23:00:25 -0800 Subject: [PATCH] fix null ops may cause coredump Signed-off-by: Neil.wrz (cherry picked from commit 2d10b2cdf7ed1def277552c20b3fb4b141b5c7bf) --- 0025-fix-ops-hierarchies-cause-coredump.patch | 32 +++++++++++++++++++ lxc.spec | 9 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0025-fix-ops-hierarchies-cause-coredump.patch diff --git a/0025-fix-ops-hierarchies-cause-coredump.patch b/0025-fix-ops-hierarchies-cause-coredump.patch new file mode 100644 index 0000000..e162e3b --- /dev/null +++ b/0025-fix-ops-hierarchies-cause-coredump.patch @@ -0,0 +1,32 @@ +From 636f30e34dd33a0b888faa9675fe33fb5aa0ad7a Mon Sep 17 00:00:00 2001 +From: "Neil.wrz" +Date: Tue, 21 Feb 2023 22:48:44 -0800 +Subject: [PATCH] may cause coredump + +--- + src/lxc/cgroups/isulad_cgfsng.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/lxc/cgroups/isulad_cgfsng.c b/src/lxc/cgroups/isulad_cgfsng.c +index 6ccff63..dcaa229 100644 +--- a/src/lxc/cgroups/isulad_cgfsng.c ++++ b/src/lxc/cgroups/isulad_cgfsng.c +@@ -938,8 +938,15 @@ __cgfsng_ops static inline bool isulad_cgfsng_payload_create(struct cgroup_ops * + struct lxc_handler *handler) + { + int i; ++ ++ if (!ops) ++ return ret_set_errno(false, ENOENT); ++ + char *container_cgroup = ops->container_cgroup; + ++ if (!ops->hierarchies) ++ return true; ++ + #ifdef HAVE_ISULAD + if (ops->no_controller) { + DEBUG("no controller found, isgnore isulad_cgfsng_payload_create"); +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 00230fe..ccd71ac 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022102411 +%global _release 2022102412 Name: lxc Version: 4.0.3 @@ -32,6 +32,7 @@ Patch0021: 0021-change-the-suffi-parameter-in-lxc-attach-help-output.patch Patch0022: 0022-fix-cve-CVE-2022-47952-log-leaks-root-information.patch Patch0023: 0023-fix-lxc-write-error-message.patch Patch0024: 0024-remove-process-inheritable-capability.patch +Patch0025: 0025-fix-ops-hierarchies-cause-coredump.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -218,6 +219,12 @@ rm -rf %{buildroot}%{_sysconfdir}/default/%{name} %endif %changelog +* Wed Feb 22 2023 wangrunze - 4.0.3-2022102412 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix ops hierarchies cause coredump + * Wed Feb 22 2023 misaka00251 - 4.0.3-2022102411 - Type:enhancement - ID:NA -- Gitee