1- From b9d020a7a6ec6a9f63f53c461c84ac88ea32c1d5 Mon Sep 17 00:00:00 2001
1+ From 35bea40b88739358a0f8e5a104e7cb1180e20f8b Mon Sep 17 00:00:00 2001
22From: Chris PeBenito <chpebeni@linux.microsoft.com>
33Date: Tue, 6 Aug 2024 11:35:33 -0400
44Subject: [PATCH 36/37] fstools: Add additional perms for cloud-utils-growpart.
@@ -7,10 +7,11 @@ Missed in previous growpart patch due to testing errors.
77
88Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
99---
10- policy/modules/admin/cloudinit.if | 38 +++++++++++++++++++++++++++++++
11- policy/modules/system/fstools.fc | 2 ++
12- policy/modules/system/fstools.te | 14 ++++++++++--
13- 3 files changed, 52 insertions(+), 2 deletions(-)
10+ policy/modules/admin/cloudinit.if | 38 +++++++++++++++++++++++++++++
11+ policy/modules/kernel/filesystem.if | 20 +++++++++++++++
12+ policy/modules/system/fstools.fc | 2 ++
13+ policy/modules/system/fstools.te | 16 ++++++++++--
14+ 4 files changed, 74 insertions(+), 2 deletions(-)
1415
1516diff --git a/policy/modules/admin/cloudinit.if b/policy/modules/admin/cloudinit.if
1617index 6d427e771..25e94729e 100644
@@ -65,6 +66,37 @@ index 6d427e771..25e94729e 100644
6566+ files_search_tmp($1)
6667+ manage_files_pattern($1, cloud_init_tmp_t, cloud_init_tmp_t)
6768+ ')
69+ diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
70+ index 2f5412c30..f6ba45dd2 100644
71+ --- a/policy/modules/kernel/filesystem.if
72+ +++ b/policy/modules/kernel/filesystem.if
73+ @@ -5552,6 +5552,26 @@ interface(`fs_getattr_tmpfs',`
74+ allow $1 tmpfs_t:filesystem getattr;
75+ ')
76+
77+ + ########################################
78+ + ## <summary>
79+ + ## Do not audit attempts to get the attributes of a tmpfs
80+ + ## filesystem.
81+ + ## </summary>
82+ + ## <param name="domain">
83+ + ## <summary>
84+ + ## Domain to not audit.
85+ + ## </summary>
86+ + ## </param>
87+ + ## <rolecap/>
88+ + #
89+ + interface(`fs_dontaudit_getattr_tmpfs',`
90+ + gen_require(`
91+ + type tmpfs_t;
92+ + ')
93+ +
94+ + dontaudit $1 tmpfs_t:filesystem getattr;
95+ + ')
96+ +
97+ ########################################
98+ ## <summary>
99+ ## Allow the type to associate to tmpfs filesystems.
68100diff --git a/policy/modules/system/fstools.fc b/policy/modules/system/fstools.fc
69101index 63423802d..0fa9fb5c0 100644
70102--- a/policy/modules/system/fstools.fc
@@ -86,10 +118,10 @@ index 63423802d..0fa9fb5c0 100644
86118 /usr/sbin/install-mbr -- gen_context(system_u:object_r:fsadm_exec_t,s0)
87119 /usr/sbin/jfs_.* -- gen_context(system_u:object_r:fsadm_exec_t,s0)
88120diff --git a/policy/modules/system/fstools.te b/policy/modules/system/fstools.te
89- index d5e090c28..18a42890c 100644
121+ index d5e090c28..49fc02b2c 100644
90122--- a/policy/modules/system/fstools.te
91123+++ b/policy/modules/system/fstools.te
92- @@ -201,8 +201,18 @@ optional_policy(`
124+ @@ -201,8 +201,20 @@ optional_policy(`
93125 ')
94126
95127 optional_policy(`
@@ -98,6 +130,8 @@ index d5e090c28..18a42890c 100644
98130+ cloudinit_manage_tmp_files(fsadm_t)
99131+ cloudinit_manage_tmp_dirs(fsadm_t)
100132+
133+ + fs_dontaudit_getattr_tmpfs(fsadm_t)
134+ +
101135+ optional_policy(`
102136+ # cloud-utils-growpart
103137+ lvm_domtrans(fsadm_t)
@@ -111,5 +145,5 @@ index d5e090c28..18a42890c 100644
111145
112146 optional_policy(`
113147- -
114- 2.46.0
148+ 2.48.1
115149
0 commit comments