Skip to contentSkip to conversation

patch: proc cleanup

PATCH Thomas Bleher 2 participants 2 messages Dec 6, 2004 – Dec 8, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

A pure cleanup patch to make some proc stuff easier to read. Please apply.

Thomas

Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages
GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA  D09E C562 2BAE B2F4 ABE7
macros/global_macros.te +2 -3
@@ -169,10 +169,9 @@
 # 
 define(`general_proc_read_access',`
 # Read system information files in /proc.
-allow $1 proc_t:dir r_dir_perms;
-allow $1 proc_t:notdevfile_class_set r_file_perms;
-allow $1 proc_mdstat_t:file r_file_perms;
+r_dir_file($1, proc_t)
 r_dir_file($1, proc_net_t)
+allow $1 proc_mdstat_t:file r_file_perms;
 
 # Stat /proc/kmsg and /proc/kcore.
 allow $1 proc_fs:file stat_file_perms;
domains/program/hotplug.te renamed from domains/program/unused/hotplug.te +1 -3
@@ -27,9 +28,7 @@
 allow hotplug_t sysctl_net_t:file { getattr read };
 
 # get info from /proc
-allow hotplug_t proc_t:dir r_dir_perms;
-allow hotplug_t proc_t:file r_file_perms;
-allow hotplug_t proc_t:lnk_file read;
+r_dir_file(hotplug_t, proc_t)
 allow hotplug_t self:file { getattr read };
 
 allow hotplug_t devtty_t:chr_file rw_file_perms;
domains/program/init.te +2 -6
@@ -87,12 +87,8 @@
 var_run_domain(init)
 
 # Shutdown permissions
-allow init_t proc_t:dir r_dir_perms;
-allow init_t proc_t:lnk_file r_file_perms;
-allow init_t proc_t:file r_file_perms;
-allow init_t self:dir r_dir_perms;
-allow init_t self:lnk_file r_file_perms;
-allow init_t self:file r_file_perms;
+r_dir_file(init_t, proc_t)
+r_dir_file(init_t, self)
 allow init_t devpts_t:dir r_dir_perms;
 
 # Modify wtmp.
domains/program/initrc.te +1 -2
@@ -34,8 +43,7 @@
 r_dir_file(initrc_t, usr_t)
 
 # Read system information files in /proc.
-allow initrc_t proc_t:dir r_dir_perms;
-allow initrc_t proc_t:{ file lnk_file } r_file_perms;
+r_dir_file(initrc_t, { proc_t proc_net_t })
 allow initrc_t proc_mdstat_t:file { getattr read };
 
 # Allow IPC with self
domains/program/login.te +1 -2
@@ -23,8 +23,7 @@
 general_domain_access($1_login_t);
 
 # Read system information files in /proc.
-allow $1_login_t proc_t:dir r_dir_perms;
-allow $1_login_t proc_t:notdevfile_class_set r_file_perms;
+r_dir_file($1_login_t, proc_t)
 
 base_file_read_access($1_login_t)
 
domains/program/sulogin.te +1 -2
@@ -32,8 +33,7 @@
 r_dir_file(sulogin_t, etc_t)
 
 allow sulogin_t bin_t:dir r_dir_perms;
-allow sulogin_t proc_t:dir r_dir_perms;
-allow sulogin_t proc_t:notdevfile_class_set r_file_perms;
+r_dir_file(sulogin_t, proc_t)
 allow sulogin_t root_t:dir search;
 
 allow sulogin_t sysadm_devpts_t:chr_file { getattr ioctl read write };
macros/user_macros.te +2 -3
@@ -39,7 +39,7 @@
 
 # for ls -l /proc
 dontaudit $1_t { sysctl_irq_t sysctl_t }:dir getattr;
-dontaudit $1_t { mtrr_device_t proc_kcore_t proc_kmsg_t }:file getattr;
+dontaudit $1_t proc_fs:file getattr;
 
 allow $1_t boot_t:dir { getattr search };
 dontaudit $1_t boot_t:dir read;
@@ -133,8 +133,7 @@
 
 attribute $1_file_type;
 # Grant read/search permissions to some of /proc.
-allow $1_t proc_t:dir r_dir_perms;
-allow $1_t proc_t:{ file lnk_file } r_file_perms;
+r_dir_file($1_t, proc_t)
 
 base_file_read_access($1_t)
 
#1 lore raw

Merged.

Quoted 4 lines · Thomas Bleher

A pure cleanup patch to make some proc stuff easier to read. Please apply.

Thomas

Signature · 7 lines
James Carter <[email protected]>
National Security Agency

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.