runc:fix systemd cgroup after memory type changed

upstream from
acaf6897f5

Signed-off-by: xiadanni <xiadanni1@huawei.com>
(cherry picked from commit c4884fd0a7ccc1b4b8851dd77df646529dd73e6b)
This commit is contained in:
xiadanni 2021-08-09 10:26:09 +08:00 committed by openeuler-sync-bot
parent c3edd04f82
commit 22caaf6e10
3 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 22fab107bdb684d3e7651804b5f6ba3c432652ca Mon Sep 17 00:00:00 2001
From: xiadanni <xiadanni1@huawei.com>
Date: Mon, 9 Aug 2021 10:16:47 +0800
Subject: [PATCH] runc:fix systemd cgroup after memory type changed
upstream from
https://github.com/opencontainers/runc/pull/1573/commits/acaf6897f566c2f592a488c83dafcddec41524be
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: xiadanni <xiadanni1@huawei.com>
---
libcontainer/cgroups/systemd/apply_systemd.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcontainer/cgroups/systemd/apply_systemd.go b/libcontainer/cgroups/systemd/apply_systemd.go
index 0411b72..a08a9a9 100644
--- a/libcontainer/cgroups/systemd/apply_systemd.go
+++ b/libcontainer/cgroups/systemd/apply_systemd.go
@@ -261,7 +261,7 @@ func (m *Manager) Apply(pid int) error {
if c.Resources.Memory != 0 {
properties = append(properties,
- newProp("MemoryLimit", c.Resources.Memory))
+ newProp("MemoryLimit", uint64(c.Resources.Memory)))
}
if c.Resources.CpuShares != 0 {
--
2.27.0

View File

@ -2,7 +2,7 @@
Name: docker-runc
Version: 1.0.0.rc3
Release: 201
Release: 202
Summary: runc is a CLI tool for spawning and running containers according to the OCI specification.
License: ASL 2.0
@ -40,6 +40,12 @@ install -p -m 755 runc $RPM_BUILD_ROOT/%{_bindir}/runc
%{_bindir}/runc
%changelog
* Mon Aug 09 2021 xiadanni<xiadanni1@huawei.com> - 1.0.0.rc3-202
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix systemd cgroup after memory type changed
* Thu Jun 03 2021 xiadanni<xiadanni1@huawei.com> - 1.0.0.rc3-201
- Type:CVE
- CVE:CVE-2021-30465

View File

@ -120,3 +120,4 @@
0121-runc-add-cpu-and-memory-info-when-print-cgroup-info.patch
0124-runc-fix-freezing-race.patch
0126-runc-add-mount-destination-validation-fix-CVE-2021.patch
0127-runc-fix-systemd-cgroup-after-memory-type-changed.patch