Add interface udev_run
PATCH v2 1/1 Add interface udev_run
Altered to use roleattribute based on suggestion
--- policy/modules/system/udev.if | 26 ++++++++++++++++++++++++++ policy/modules/system/udev.te | 2 ++ 2 files changed, 28 insertions(+)
policy/modules/system/udev.if +26 -0
@@ -36,6 +36,32 @@ interface(`udev_domtrans',` domtrans_pattern($1, udev_exec_t, udev_t) ') +######################################## +## <summary> +## Execute udev in the udev domain, and +## allow the specified role the udev domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <rolecap/> +# +interface(`udev_run',` + gen_require(` + attribute_role udev_roles; + ') + + udev_domtrans($1) + roleattribute $2 udev_roles; +') + ######################################## ## <summary> ## Allow udev to execute the specified program in
policy/modules/system/udev.te +2 -0
@@ -4,6 +4,7 @@ policy_module(udev, 1.25.0) # # Declarations # +attribute_role udev_roles; type udev_t; type udev_exec_t;
@@ -14,6 +15,7 @@ domain_entry_file(udev_t, udev_helper_exec_t) domain_interactive_fd(udev_t) init_daemon_domain(udev_t, udev_exec_t) init_named_socket_activation(udev_t, udev_var_run_t) +role udev_roles types udev_t; type udev_etc_t alias etc_udev_t; files_config_file(udev_etc_t)
Signature · 1 line
2.20.1
PATCH 1/1 Allow map permission when reading hwdb
I'm seeing a denial for udev to map /etc/udev/hwdb.bin. This updates the existing interface to include allowing to map the file.
type=AVC msg=audit(1551886176.948:642): avc: denied { map } for pid=5187 comm="systemd-udevd" path="/etc/udev/hwdb.bin" dev="dm-1" ino=6509618 scontext=system_u:system_r:udev_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_hwdb_t:s0 tclass=file permissive=1
--- policy/modules/system/systemd.if | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/system/systemd.if +1 -1
@@ -34,7 +34,7 @@ interface(`systemd_read_hwdb',` type systemd_hwdb_t; ') - read_files_pattern($1, systemd_hwdb_t, systemd_hwdb_t) + mmap_read_files_pattern($1, systemd_hwdb_t, systemd_hwdb_t) ') ######################################
Signature · 1 line
2.20.1
Re: [PATCH] Allow map permission when reading hwdb
Quoted 16 lines · David
I'm seeing a denial for udev to map
/etc/udev/hwdb.bin. This updates the existing interface to include allowing to map the file.type=AVC msg=audit(1551886176.948:642): avc: denied { map } for pid=5187 comm="systemd-udevd" path="/etc/udev/hwdb.bin" dev="dm-1" ino=6509618 scontext=system_u:system_r:udev_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_hwdb_t:s0 tclass=file permissive=1
Signed-off-by Dave Sugar <[email protected]>--- policy/modules/system/systemd.if | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)policy/modules/system/systemd.if +0
-0
policy/modules/system/systemd.if interface(`systemd_read_hwdb',` · line 40
Quoted 8 lines
policy/modules/system/systemd.if +1
-1@@ -34,7 +34,7 @@ interface(`systemd_read_hwdb',` type systemd_hwdb_t; ') - read_files_pattern($1, systemd_hwdb_t, systemd_hwdb_t) + mmap_read_files_pattern($1, systemd_hwdb_t, systemd_hwdb_t) ') ######################################
This should be a new interface.
Signature · 1 line
Chris PeBenito
Quoted 31 lines · David
Altered to use roleattribute based on suggestion
Signed-off-by Dave Sugar <[email protected]>--- policy/modules/system/udev.if | 26 ++++++++++++++++++++++++++ policy/modules/system/udev.te | 2 ++ 2 files changed, 28 insertions(+)policy/modules/system/udev.if +15
-0@@ -36,6 +36,32 @@ interface(`udev_domtrans',` domtrans_pattern($1, udev_exec_t, udev_t) ') +######################################## +## <summary> +## Execute udev in the udev domain, and +## allow the specified role the udev domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param>
policy/modules/system/udev.if interface(`udev_domtrans',` · line 63
Quoted 10 lines
policy/modules/system/udev.if +10
-0+## <rolecap/> +# +interface(`udev_run',` + gen_require(` + attribute_role udev_roles; + ') + + udev_domtrans($1) + roleattribute $2 udev_roles; +')
Why is a user be starting this?
Signature · 1 line
Chris PeBenito
Quoted 36 lines · Chris PeBenito
Quoted 35 lines · David
Altered to use roleattribute based on suggestion
Signed-off-by Dave Sugar <[email protected]>---
policy/modules/system/udev.if | 26 ++++++++++++++++++++++++++ policy/modules/system/udev.te | 2 ++2 files changed, 28 insertions(+)policy/modules/system/udev.if +19
-0@@ -36,6 +36,32 @@ interface(`udev_domtrans',` domtrans_pattern($1, udev_exec_t, udev_t) ') +######################################## +## <summary> +## Execute udev in the udev domain, and +## allow the specified role the udev domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <rolecap/> +# +interface(`udev_run',` + gen_require(`
Quoted 9 lines
policy/modules/system/udev.if interface(`udev_domtrans',` · line 63
Quoted 6 lines
policy/modules/system/udev.if +6
-0+ attribute_role udev_roles; + ') + + udev_domtrans($1) + roleattribute $2 udev_roles; +')Why is a user be starting this?
In this case it isn't a user starting udev, rather calling "/usr/bin/udevadm info" to gather all the specific information about a USB device. udevadm is labeled udev_exec_t.
Quoted 48 lines · David
Quoted 36 lines · Chris PeBenito
Quoted 35 lines · David
Altered to use roleattribute based on suggestion
Signed-off-by Dave Sugar <[email protected]>--- policy/modules/system/udev.if | 26 ++++++++++++++++++++++++++ policy/modules/system/udev.te | 2 ++ 2 files changed, 28 insertions(+)policy/modules/system/udev.if +19
-0@@ -36,6 +36,32 @@ interface(`udev_domtrans',` domtrans_pattern($1, udev_exec_t, udev_t) ') +######################################## +## <summary> +## Execute udev in the udev domain, and +## allow the specified role the udev domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <rolecap/> +# +interface(`udev_run',` + gen_require(`Quoted 9 lines
policy/modules/system/udev.if interface(`udev_domtrans',` · line 63
Quoted 6 lines
policy/modules/system/udev.if +6
-0+ attribute_role udev_roles; + ') + + udev_domtrans($1) + roleattribute $2 udev_roles; +')Why is a user be starting this?
Quoted 3 lines
In this case it isn't a user starting udev, rather calling "
/usr/bin/udevadminfo" to gather all the specific information about a USB device. udevadm is labeledudev_exec_t.
In that case I'd be more interested in seeing what it would take for a separate udevadm domain. If that proves to be too much like udev_t, then I'd accept the above patch.
Signature · 1 line
Chris PeBenito