fix null ops hierarchies cause coredump
Signed-off-by: Neil.wrz <wangrunze13@huawei.com> (cherry picked from commit 3e7c0a2fd6dbc43dc2bed7d014be66c8deddcb07)
This commit is contained in:
parent
f27e4489da
commit
da055098c4
32
0061-fix-ops-hierarchies-cause-coredump.patch
Normal file
32
0061-fix-ops-hierarchies-cause-coredump.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From 269158eb97dc4bd72e77e12ddcab6295ef3f8d01 Mon Sep 17 00:00:00 2001
|
||||
From: "Neil.wrz" <wangrunze13@huawei.com>
|
||||
Date: Thu, 23 Feb 2023 00:12:34 -0800
|
||||
Subject: [PATCH] null ops 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
|
||||
|
||||
9
lxc.spec
9
lxc.spec
@ -1,4 +1,4 @@
|
||||
%global _release 2022102412
|
||||
%global _release 2022102413
|
||||
|
||||
Name: lxc
|
||||
Version: 4.0.3
|
||||
@ -68,6 +68,7 @@ Patch0057: 0057-fix-lxc-write-error-message.patch
|
||||
Patch0058: 0058-add-loongarch64-support-for-lxc.patch
|
||||
Patch0059: 0059-remove-process-inheritable-capability.patch
|
||||
Patch0060: 0060-check-yajl-only-when-have-isulad.patch
|
||||
Patch0061: 0061-fix-ops-hierarchies-cause-coredump.patch
|
||||
|
||||
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
|
||||
BuildRequires: pkgconfig(libseccomp)
|
||||
@ -248,6 +249,12 @@ make check
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Feb 23 2023 wangrunze<wangrunze13@huawei.com> - 4.0.3-2022102413
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: fix null ops hierarchies cause coredump
|
||||
|
||||
* Tue Feb 21 2023 wangrunze<wangrunze13@huawei.com> - 4.0.3-2022102412
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user