From 5358fda106b88d45f3c588dd34bebdd840193bba Mon Sep 17 00:00:00 2001 From: maminjie Date: Mon, 15 Mar 2021 12:58:44 +0800 Subject: [PATCH] Fix the invalid memory address reference --- ...the-invalid-memory-address-reference.patch | 31 +++++++++++++++++++ podman.spec | 7 ++++- 2 files changed, 37 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 f397998..d0e0bfb 100644 --- a/podman.spec +++ b/podman.spec @@ -1,6 +1,6 @@ Name: podman Version: 0.10.1 -Release: 6 +Release: 7 Summary: A daemonless container engine for managing Containers Epoch: 1 License: ASL 2.0 @@ -107,11 +107,13 @@ Provides: bundled(golang(k8s.io/apiserver)) = 4d1163080139f1f9094baf8a3a6099e85e Provides: bundled(golang(k8s.io/client-go)) = 7cd1d3291b7d9b1e2d54d4b69eb65995eaf8888e Provides: bundled(golang(k8s.io/kube-openapi)) = 275e2ce91dec4c05a4094a7b1daee5560b555ac9 Provides: bundled(golang(k8s.io/utils)) = 258e2a2fa64568210fbd6267cf1d8fd87c3cb86e + Patch1: 0001-podman-patch-for-local-search.patch 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 +217,9 @@ install -Dp -m644 libpod.conf %{buildroot}%{_datadir}/containers/libpod.conf %{_mandir}/man5/*.5* %changelog +* Sat Mar 13 2021 maminjie - 1:0.10.1-7 +- Fix the invalid memory address reference + * Thu Mar 4 2021 wangxiao - 1:0.10.1-6 - Fix CVE-2021-20188 -- Gitee