Skip to contentSkip to conversation

grant permission to map security_t

PATCH Superseded Sugar, David 2 participants 2 messages Jul 2, 2019 – Jul 9, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 grant permission to map security_t

I'm seeing the following denial while installing RPMs.

type=AVC msg=audit(1560944462.698:217): avc: denied { map } for pid=1265 comm="rpm" path="/sys/fs/selinux/status" dev="selinuxfs" ino=19 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file permissive=1

The RedHat targeted policy has the change in this patch. I'm not sure if this is preferred, or if it would be better to create a new interface 'selinux_map_security_files' (or similar).

---
 policy/modules/kernel/selinux.if | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/kernel/selinux.if +1 -1
index 6790e5d0..f0504613 100644
@@ -492,7 +492,7 @@ interface(`selinux_validate_context',`
 
 	dev_search_sysfs($1)
 	allow $1 security_t:dir list_dir_perms;
-	allow $1 security_t:file rw_file_perms;
+	allow $1 security_t:file { map rw_file_perms };
 	allow $1 security_t:security check_context;
 ')
 
Signature · 1 line
2.21.0
#1 lore raw
Quoted 6 lines · David

I'm seeing the following denial while installing RPMs.

type=AVC msg=audit(1560944462.698:217): avc: denied { map } for pid=1265 comm="rpm" path="/sys/fs/selinux/status" dev="selinuxfs" ino=19 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file permissive=1

The RedHat targeted policy has the change in this patch. I'm not sure if this is preferred, or if it would be better to create a new interface 'selinux_map_security_files' (or similar).

That would be preferred, as this is not a typical behavior.

Quoted 19 lines
---
  policy/modules/kernel/selinux.if | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
policy/modules/kernel/selinux.if +1 -1
index 6790e5d0..f0504613 100644
@@ -492,7 +492,7 @@ interface(`selinux_validate_context',`
 
  	dev_search_sysfs($1)
  	allow $1 security_t:dir list_dir_perms;
-	allow $1 security_t:file rw_file_perms;
+	allow $1 security_t:file { map rw_file_perms };
  	allow $1 security_t:security check_context;
  ')
 
Signature · 1 line
Chris PeBenito