Skip to content

Commit c82b8d9

Browse files
committed
overlay coreos/user-patches: Update selinux policies patch
1 parent ae2f509 commit c82b8d9

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sec-policy/flatcar-selinux-patches/0001-Flatcar-modifications.patch

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 64428b758960e3fce1389ee05930172a02b8b317 Mon Sep 17 00:00:00 2001
1+
From b4725fecc9298279266ecfd842536b1b1c03cdb0 Mon Sep 17 00:00:00 2001
22
From: Krzesimir Nowak <[email protected]>
33
Date: Mon, 4 Dec 2023 12:17:25 +0100
44
Subject: [PATCH] Flatcar modifications
@@ -8,13 +8,13 @@ Subject: [PATCH] Flatcar modifications
88
policy/modules/kernel/corenetwork.if.in | 26 ++++
99
policy/modules/kernel/corenetwork.te.in | 12 +-
1010
policy/modules/kernel/files.if | 45 +++++++
11-
policy/modules/kernel/kernel.te | 84 ++++++++++++
11+
policy/modules/kernel/kernel.te | 125 +++++++++++++++++
1212
policy/modules/services/container.fc | 6 +
1313
policy/modules/services/container.te | 170 +++++++++++++++++++++++-
1414
policy/modules/system/init.te | 8 ++
1515
policy/modules/system/locallogin.te | 9 +-
1616
policy/modules/system/logging.te | 9 ++
17-
10 files changed, 386 insertions(+), 3 deletions(-)
17+
10 files changed, 427 insertions(+), 3 deletions(-)
1818

1919
diff --git a/refpolicy/policy/modules/admin/netutils.te b/refpolicy/policy/modules/admin/netutils.te
2020
index 63d2f9cb8..62dff5f94 100644
@@ -168,10 +168,10 @@ index 778e82713..d1bd353e0 100644
168168
+ relabelfrom_chr_files_pattern($1, { file_type -policy_config_t $2 }, { file_type -policy_config_t $2 })
169169
+')
170170
diff --git a/refpolicy/policy/modules/kernel/kernel.te b/refpolicy/policy/modules/kernel/kernel.te
171-
index b791ebc71..c0f754870 100644
171+
index b791ebc71..c80159473 100644
172172
--- a/refpolicy/policy/modules/kernel/kernel.te
173173
+++ b/refpolicy/policy/modules/kernel/kernel.te
174-
@@ -377,6 +377,90 @@ files_mounton_default(kernel_t)
174+
@@ -377,6 +377,131 @@ files_mounton_default(kernel_t)
175175

176176
mcs_process_set_categories(kernel_t)
177177

@@ -258,6 +258,47 @@ index b791ebc71..c0f754870 100644
258258
+optional_policy(`
259259
+ mount_watch_reads_runtime_files(kernel_t)
260260
+')
261+
+
262+
+#
263+
+# FLATCAR:
264+
+#
265+
+# This one happens in cl.update.docker-btrfs-compat, cl.update.oem and cl.update.payload.
266+
+#
267+
+# avc: denied { perfmon } for pid=[0-9]* comm="systemd" capability=38 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=1
268+
+# avc: denied { perfmon } for pid=[0-9]* comm="systemd" capability=38 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=0
269+
+# avc: denied { perfmon } for pid=[0-9]* comm="runc" capability=38 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=0
270+
+#
271+
+allow kernel_t self:capability2 { perfmon };
272+
+
273+
+#
274+
+# FLATCAR:
275+
+#
276+
+# This one happens in sysext.zfs.reboot. The kernel module is a part
277+
+# of sysext, and it probably is labeled wrong.
278+
+#
279+
+# avc: denied { module_load } for pid=[0-9]* comm="modprobe" path="/usr/lib/modules/6.6.56-flatcar/extra/spl.ko" dev="overlay" ino=[0-9]* scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=system permissive=1
280+
+#
281+
+allow kernel_t unlabeled_t:system { module_load };
282+
+
283+
+#
284+
+# FLATCAR:
285+
+#
286+
+# This one happens in cl.update.docker-btrfs-compat, cl.update.oem and cl.update.payload.
287+
+#
288+
+# avc: denied { confidentiality } for pid=[0-9]* comm="systemd-udevd" lockdown_reason="use of tracefs" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=lockdown permissive=1
289+
+#
290+
+allow kernel_t self:lockdown { confidentiality };
291+
+
292+
+#
293+
+# FLATCAR:
294+
+#
295+
+# This one happens in cl.update.docker-btrfs-compat, cl.update.oem and cl.update.payload.
296+
+#
297+
+# avc: denied { bpf } for pid=[0-9]* comm="systemd" capability=39 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=1
298+
+# avc: denied { bpf } for pid=[0-9]* comm="systemd" capability=39 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=0
299+
+# avc: denied { bpf } for pid=[0-9]* comm="runc" capability=39 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=capability2 permissive=0
300+
+#
301+
+allow kernel_t self:capability2 { bpf };
261302
+
262303
mls_process_read_all_levels(kernel_t)
263304
mls_process_write_all_levels(kernel_t)

0 commit comments

Comments
 (0)