Skip to contentSkip to conversation

policy for firmware update daemon fwupd

PATCH New Russell Coker 1 participant 1 message Aug 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policy for firmware update daemon fwupd

This adds policy for the firmware update daemon, it updates system BIOS as well as connected devices such as Thunderbolt docks. I think it's ready to merge.

policy/modules/system/fwupd.fc new file +5 -0
Index: refpolicy-2.20230629/policy/modules/system/fwupd.fc
===================================================================
@@ -0,0 +1,5 @@
+/usr/bin/fwupdmgr	--	gen_context(system_u:object_r:fwupd_exec_t,s0)
+/usr/libexec/fwupd/fwupd --	gen_context(system_u:object_r:fwupd_exec_t,s0)
+/var/lib/fwupd(/.*)?		gen_context(system_u:object_r:fwupd_var_lib_t,s0)
+/var/cache/fwupd(/.*)?		gen_context(system_u:object_r:fwupd_cache_t,s0)
+/etc/fwupd(/.*)?		gen_context(system_u:object_r:fwupd_conf_t,s0)
policy/modules/system/fwupd.if new file +29 -0
Index: refpolicy-2.20230629/policy/modules/system/fwupd.if
===================================================================
@@ -0,0 +1,29 @@
+## <summary>Policy for firmwate update daemon and utility.</summary>
+
+########################################
+## <summary>
+##      Execute fwupd in the user role
+##      the kmod domain, and use the caller's terminal.
+##      Has a sigchld backchannel.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      Domain allowed to transition.
+##      </summary>
+## </param>
+## <param name="role">
+##      <summary>
+##      Role allowed access.
+##      </summary>
+## </param>
+## <rolecap/>
+#
+interface(`fwupd_run',`
+	gen_require(`
+		attribute_role fwupd_roles;
+		type fwupd_exec_t, fwupd_t;
+	')
+
+	domtrans_pattern($1, fwupd_exec_t, fwupd_t)
+	roleattribute $2 fwupd_roles;
+')
policy/modules/system/fwupd.te new file +153 -0

153 lines not on this page · raw message

policy/modules/roles/sysadm.te +4 -0
Index: refpolicy-2.20230629/policy/modules/roles/sysadm.te
===================================================================
@@ -448,6 +448,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	fwupd_run(sysadm_t, sysadm_r)
+')
+
+optional_policy(`
 	gatekeeper_admin(sysadm_t, sysadm_r)
 ')
 
policy/modules/system/unconfined.te +4 -0
Index: refpolicy-2.20230629/policy/modules/system/unconfined.te
===================================================================
@@ -107,6 +107,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	fwupd_run(unconfined_t, unconfined_r)
+')
+
+optional_policy(`
 	hadoop_role(unconfined, unconfined_t, unconfined_application_exec_domain, unconfined_r)
 ')
 
policy/modules/kernel/devices.if +18 -0
Index: refpolicy-2.20230629/policy/modules/kernel/devices.if
===================================================================
@@ -2826,6 +2826,24 @@ interface(`dev_delete_lvm_control_dev',`
 
 ########################################
 ## <summary>
+##	Read and write the Intel mei control device.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`dev_rw_mei_device',`
+	gen_require(`
+		type device_t, mei_device_t;
+	')
+
+	rw_chr_files_pattern($1, device_t, mei_device_t)
+')
+
+########################################
+## <summary>
 ##	dontaudit getattr raw memory devices (e.g. /dev/mem).
 ## </summary>
 ## <param name="domain">