summaryrefslogtreecommitdiffstats
path: root/recipes-containers/cri-o/files/CVE-2023-6476.patch
diff options
context:
space:
mode:
authorArchana Polampalli <archana.polampalli@windriver.com>2025-07-11 17:07:22 +0530
committerBruce Ashfield <bruce.ashfield@gmail.com>2025-07-16 14:49:43 -0400
commit3e4dba95e6b5f5f68d0b3a5899b106c89da59428 (patch)
tree3dfa2c315daa2fb88a33e6dcff31cd4216085826 /recipes-containers/cri-o/files/CVE-2023-6476.patch
parent227cefa1261daf20b7d9737541994ec2bba629fc (diff)
downloadmeta-virtualization-kirkstone.tar.gz
cri-o: fix CVE-2023-6476kirkstone
A flaw was found in CRI-O that involves an experimental annotation leading to a container being unconfined. This may allow a pod to specify and get any amount of memory/cpu, circumventing the kubernetes scheduler and potentially resulting in a denial of service in the node. Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/cri-o/files/CVE-2023-6476.patch')
-rw-r--r--recipes-containers/cri-o/files/CVE-2023-6476.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/recipes-containers/cri-o/files/CVE-2023-6476.patch b/recipes-containers/cri-o/files/CVE-2023-6476.patch
new file mode 100644
index 00000000..baa3bb54
--- /dev/null
+++ b/recipes-containers/cri-o/files/CVE-2023-6476.patch
@@ -0,0 +1,61 @@
1From 5faee5d82556a6bf4dd1144d2a86e70d097ab200 Mon Sep 17 00:00:00 2001
2From: Peter Hunt <pehunt@redhat.com>
3Date: Thu, 7 Dec 2023 16:07:12 -0500
4Subject: [PATCH] allowed annotations: correctly filter prefixed annotations
5
6without this fix, a pod is able to gain access to experimental annotations that are prefixes of container names.
7The most problematic of these is io.kubernetes.cri-o.UnifiedCgroup, which allows a user to arbitrarily
8change the resources of the pod, potentially leading to OOM.
9
10Fixes CVE-2023-6476
11
12Signed-off-by: Peter Hunt <pehunt@redhat.com>
13
14CVE: CVE-2023-6476
15
16Upstream-Status: Backport [https://github.com/cri-o/cri-o/commit/5faee5d82556a6bf4dd1144d2a86e70d097ab200]
17
18Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
19---
20 pkg/config/workloads.go | 2 +-
21 test/workloads.bats | 15 +++++++++++++++
22 2 files changed, 16 insertions(+), 1 deletion(-)
23
24diff --git a/pkg/config/workloads.go b/pkg/config/workloads.go
25index d5eeaf1ef..37a22fe76 100644
26--- a/pkg/config/workloads.go
27+++ b/pkg/config/workloads.go
28@@ -102,7 +102,7 @@ func (w Workloads) FilterDisallowedAnnotations(allowed []string, toFilter map[st
29 for ann := range toFilter {
30 for _, d := range disallowed {
31 if strings.HasPrefix(ann, d) {
32- delete(toFilter, d)
33+ delete(toFilter, ann)
34 }
35 }
36 }
37diff --git a/test/workloads.bats b/test/workloads.bats
38index 6102d6326..0f4d6e4f0 100644
39--- a/test/workloads.bats
40+++ b/test/workloads.bats
41@@ -327,3 +327,18 @@ function check_conmon_fields() {
42 df=$(crictl exec --sync "$ctr_id" df | grep /dev/shm)
43 [[ "$df" == *'16384'* ]]
44 }
45+
46+@test "test workload pod should not be set if annotation not specified even if prefix" {
47+ start_crio
48+
49+ jq ' .annotations["io.kubernetes.cri-o.UnifiedCgroup.podsandbox-sleep"] = "memory.max=4294967296" |
50+ .labels["io.kubernetes.container.name"] = "podsandbox-sleep"' \
51+ "$TESTDATA"/sandbox_config.json > "$sboxconfig"
52+
53+ jq ' .annotations["io.kubernetes.cri-o.UnifiedCgroup.podsandbox-sleep"] = "memory.max=4294967296" |
54+ .labels["io.kubernetes.container.name"] = "podsandbox-sleep"' \
55+ "$TESTDATA"/container_sleep.json > "$ctrconfig"
56+
57+ ctr_id=$(crictl run "$ctrconfig" "$sboxconfig")
58+ [[ $(crictl exec "$ctr_id" cat /sys/fs/cgroup/memory.max) != 4294967296 ]]
59+}
60--
612.40.0