Skip to contentSkip to conversation

udev policy

PATCH Russell Coker 2 participants 3 messages Sep 1, 2004 – Sep 2, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The attached patch allows udev in rawhide to work properly with no audit messages.

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page
program/unused/udev.te renamed from usr/src/se/policy/domains/program/unused/udev.te +7 -1
@@ -43,7 +43,8 @@
 allow udev_t { device_t device_type }:{chr_file blk_file} { relabelfrom relabelto create_file_perms };
 	
 # to read the file_contexts file
-r_dir_file(udev_t, { selinux_config_t file_context_t default_context_t } )
+allow udev_t { selinux_config_t default_context_t file_context_t }:dir search;
+allow udev_t { selinux_config_t file_context_t }:file { getattr read };
 
 allow udev_t policy_config_t:dir { search };
 allow udev_t proc_t:file { read };
@@ -82,6 +83,11 @@
 ifdef(`consoletype.te', `
 can_exec(udev_t, consoletype_exec_t)
 ')
+ifdef(`pamconsole.te', `
+allow udev_t pam_var_console_t:dir search;
+')
+allow udev_t var_lock_t:dir search;
+allow udev_t var_lock_t:file getattr;
 domain_auto_trans(udev_t, ifconfig_exec_t, ifconfig_t)
 ifdef(`hide_broken_symptoms', `
 dontaudit ifconfig_t udev_t:unix_dgram_socket { read write };
#1 lore raw
Quoted 2 lines · Russell Coker

The attached patch allows udev in rawhide to work properly with no audit messages.

program/unused/udev.te renamed from usr/src/se/policy/domains/program/unused/udev.te +2 -1
@@ -43,7 +43,8 @@
 allow udev_t { device_t device_type }:{chr_file blk_file} { relabelfrom relabelto create_file_perms };
 	
 # to read the file_contexts file
-r_dir_file(udev_t, { selinux_config_t file_context_t default_context_t } )
+allow udev_t { selinux_config_t default_context_t file_context_t }:dir search;
+allow udev_t { selinux_config_t file_context_t }:file { getattr read };
 
 allow udev_t policy_config_t:dir { search };
 allow udev_t proc_t:file { read };

What's wrong with using r_dir_file here?

Signature · 8 lines
Stephen Smalley <[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.
#2 lore raw
Quoted 16 lines · Stephen Smalley
Quoted 2 lines · Russell Coker

The attached patch allows udev in rawhide to work properly with no audit messages.

--- /usr/src/se/policy/domains/program/unused/udev.te 2004-09-01 10:52:36.000000000 +1000 +++ domains/program/unused/udev.te 2004-09-01 17:51:52.000000000 +1000 @@ -43,7 +43,8 @@
allow udev_t { device_t device_type }:{chr_file blk_file} { relabelfrom
relabelto create_file_perms };

 # to read the file_contexts file
(quoted diff) +1 -1
-r_dir_file(udev_t, { selinux_config_t file_context_t default_context_t } )
+allow udev_t { selinux_config_t default_context_t file_context_t }:dir

search; +allow udev_t { selinux_config_t file_context_t }:file { getattr read };

Quoted 4 lines

allow udev_t policy_config_t:dir { search };
allow udev_t proc_t:file { read };

What's wrong with using r_dir_file here?

Sure, we could do that just as easily:

r_dir_file(udev_t, { selinux_config_t file_context_t }) allow udev_t default_context_t:dir search;

We don't seem to need access to default_context_t:file or lnk_file access to any of those types. But I guess that adding the lnk_file access is not a bad idea to avoid unexpected breakage if the sys-admin does something unexpected.

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
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.