From e44284be3fc309f02e803bb113aac17c3ddeca61 Mon Sep 17 00:00:00 2001 From: maminjie Date: Mon, 15 Mar 2021 13:02:19 +0800 Subject: [PATCH] Fix the invalid memory address reference --- ...the-invalid-memory-address-reference.patch | 31 +++++++++++++++++++ podman.spec | 6 +++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0002-Fix-the-invalid-memory-address-reference.patch diff --git a/0002-Fix-the-invalid-memory-address-reference.patch b/0002-Fix-the-invalid-memory-address-reference.patch new file mode 100644 index 0000000..0373f10 --- /dev/null +++ b/0002-Fix-the-invalid-memory-address-reference.patch @@ -0,0 +1,31 @@ +From a9e6a71f9435a50c582993e946be4d53828bb48d Mon Sep 17 00:00:00 2001 +From: maminjie +Date: Sat, 13 Mar 2021 16:03:03 +0800 +Subject: [PATCH] Fix the invalid memory address or nil pointer reference + +--- + libpod/stats.go | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/libpod/stats.go b/libpod/stats.go +index c58a461..97a2169 100644 +--- a/libpod/stats.go ++++ b/libpod/stats.go +@@ -57,9 +57,11 @@ func (c *Container) GetContainerStats(previousStats *ContainerStats) (*Container + previousCPU := previousStats.CPUNano + previousSystem := previousStats.SystemNano + stats.CPU = calculateCPUPercent(cgroupStats, previousCPU, previousSystem) +- stats.MemUsage = cgroupStats.Memory.Usage.Usage +- stats.MemLimit = getMemLimit(cgroupStats.Memory.Usage.Limit) +- stats.MemPerc = (float64(stats.MemUsage) / float64(stats.MemLimit)) * 100 ++ if cgroupStats.Memory != nil { ++ stats.MemUsage = cgroupStats.Memory.Usage.Usage ++ stats.MemLimit = getMemLimit(cgroupStats.Memory.Usage.Limit) ++ stats.MemPerc = (float64(stats.MemUsage) / float64(stats.MemLimit)) * 100 ++ } + stats.PIDs = 0 + if conState == ContainerStateRunning { + stats.PIDs = cgroupStats.Pids.Current +-- +2.23.0 + diff --git a/podman.spec b/podman.spec index 9cb93d2..9a73163 100644 --- a/podman.spec +++ b/podman.spec @@ -1,6 +1,6 @@ Name: podman Version: 0.10.1 -Release: 5 +Release: 6 Summary: A daemonless container engine for managing Containers Epoch: 1 License: ASL 2.0 @@ -113,6 +113,7 @@ Patch2: CVE-2021-20188-PRE1.patch Patch3: CVE-2021-20188-PRE2.patch Patch4: CVE-2021-20188-PRE3.patch Patch5: CVE-2021-20188.patch +Patch6: 0002-Fix-the-invalid-memory-address-reference.patch %description Podman manages the entire container ecosystem which includes pods, @@ -215,6 +216,9 @@ install -Dp -m644 libpod.conf %{buildroot}%{_datadir}/containers/libpod.conf %{_mandir}/man5/*.5* %changelog +* Sat Mar 13 2021 maminjie - 1:0.10.1-6 +- Fix the invalid memory address reference + * Thu Mar 4 2021 wangxiao - 1:0.10.1-5 - Fix CVE-2021-20188 -- Gitee