Skip to contentSkip to conversation

policy

PATCH Russell Coker 2 participants 2 messages Jan 2, 2005 – Jan 5, 2005

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

udev.diff just combines a couple of lines into a single line.

diff changes the Makefile to have it not run setfiles -q needlessly (good for when a script runs "make install" a few hundred times).

Adds a couple of lines to assert.te.

Adds hide_broken_symptoms to ldconfig.te (there is no good cause for ldconfig_t to access a TCP socket).

Changes ftpd.te to allow access to home_root_t for the case of NFS root. This means that if you have home directories individually mounted on /home/user then things will still work (and there's no harm in granting such access).

Added some extra access that seems to be needed by the latest version of howl.

Removed the memory_device_t commend from xdm.te - we should not need to re-enable that.

Removed redundant entries from types.fc relating to the old locations before /etc/selinux was used.

Add support for the Debian locations for pmap_dump and pmap_set. I wonder whether those files will have to change locations in other distributions for the case of /usr on NFS...

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
udev.te.new renamed from udev.te +1 -2
@@ -44,7 +44,7 @@
 # for arping used for static IP addresses on PCMCIA ethernet
 domain_auto_trans(udev_t, netutils_exec_t, netutils_t)
 ')
-allow udev_t etc_t:file { getattr read };
+allow udev_t etc_t:file { getattr read ioctl };
 allow udev_t { bin_t sbin_t }:dir r_dir_perms;
 allow udev_t { sbin_t bin_t }:lnk_file read;
 allow udev_t bin_t:lnk_file read;
@@ -80,7 +80,6 @@
 ')
 allow udev_t devpts_t:dir { getattr search };
 allow udev_t etc_runtime_t:file { getattr read };
-allow udev_t etc_t:file ioctl;
 ifdef(`xdm.te', `
 allow udev_t xdm_var_run_t:file { getattr read };
 ')
Makefile.new renamed from usr/src/se/policy/Makefile +3 -1
@@ -72,10 +72,12 @@
 
 ROOTFILES = $(addprefix $(APPDIR)/users/,root)
 
-install: $(APPFILES) $(ROOTFILES) $(LOADPATH) $(FCPATH) $(USERPATH)/system.users $(USERPATH)/local.users
+tmp/valid_fc: $(APPFILES) $(ROOTFILES) $(LOADPATH) $(FCPATH) $(USERPATH)/system.users $(USERPATH)/local.users
 	@echo "Validating file_contexts ..."	
 	$(SETFILES) -q -c $(LOADPATH) $(FCPATH)
 
+install: tmp/valid_fc
+
 $(CONTEXTPATH)/files/media: appconfig/media
 	mkdir -p $(CONTEXTPATH)/files/
 	install -m 644 $< $@
assert.te renamed from usr/src/se/policy/assert.te +2 -0
@@ -124,6 +124,8 @@
 ifdef(`ypbind.te', `assert_execute(ypbind)')
 ifdef(`xfs.te', `assert_execute(xfs)')
 ifdef(`gpm.te', `assert_execute(gpm)')
+ifdef(`ifconfig.te', `assert_execute(ifconfig)')
+ifdef(`iptables.te', `assert_execute(iptables)')
 
 ifdef(`login.te', `
 neverallow { local_login_t remote_login_t } ~{ login_exec_t ifdef(`pam.te', `pam_exec_t') }:file entrypoint;
program/ldconfig.te renamed from usr/src/se/policy/domains/program/ldconfig.te +3 -1
@@ -44,6 +44,8 @@
 ')
 
 allow ldconfig_t proc_t:file read;
+ifdef(`hide_broken_symptoms', `
 ifdef(`unconfined.te',`
 dontaudit ldconfig_t unconfined_t:tcp_socket { read write };
-');
+')
+')dnl end hide_broken_symptoms
domains/program/unused/ftpd.te renamed from usr/src/se/policy/domains/program/unused/ftpd.te +5 -7
@@ -96,16 +99,14 @@
 # Allow ftp to read/write files in the user home directories.
 bool ftp_home_dir false;
 
+if (ftp_home_dir) {
+# allow access to /home
+allow ftpd_t home_root_t:dir { getattr search };
+}
+
 if (ftp_home_dir && use_nfs_home_dirs) {
 allow ftpd_t nfs_t:dir r_dir_perms;
 allow ftpd_t nfs_t:file r_file_perms;
-# dont allow access to /home
-dontaudit ftpd_t home_root_t:dir { getattr search };
-} 
-else 
-{
-# allow access to /home
-allow ftpd_t home_root_t:dir { getattr search };
 }
 dontaudit ftpd_t selinux_config_t:dir search;
 #
domains/program/unused/howl.te renamed from usr/src/se/policy/domains/program/unused/howl.te +4 -2
@@ -4,8 +4,8 @@
 #
 
 daemon_domain(howl)
-allow howl_t proc_net_t:dir search;
-allow howl_t proc_net_t:file {getattr read };
+allow howl_t proc_net_t:dir r_dir_perms;
+allow howl_t proc_net_t:file { getattr read };
 can_network_server(howl_t)
 can_ypbind(howl_t)
 allow howl_t self:capability { kill net_admin };
@@ -15,6 +15,8 @@
 type howl_port_t, port_type;
 allow howl_t howl_port_t:{ udp_socket tcp_socket } name_bind;
 
+allow howl_t self:unix_dgram_socket create_socket_perms;
+
 allow howl_t etc_t:file { getattr read };
 allow howl_t initrc_var_run_t:file rw_file_perms;
 
domains/program/unused/rpm.te renamed from usr/src/se/policy/domains/program/unused/rpm.te +5 -0
@@ -66,6 +66,11 @@
 domain_auto_trans(rpm_script_t, cupsd_exec_t, cupsd_t)
 ')
 
+ifdef(`gpg.te', `
+# gpg wants this so it does not dump core on errors
+allow rpm_t self:process { setrlimit };
+')
+
 # for a bug in rm
 dontaudit initrc_t pidfile:file write;
 
program/unused/xdm.te renamed from usr/src/se/policy/domains/program/unused/xdm.te +0 -4
@@ -70,10 +70,6 @@
 # Use capabilities.
 allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner };
 
-# Use /dev/mem.
-# Commented out by default.
-#allow xdm_t memory_device_t:chr_file { execute read write };
-
 allow xdm_t { urandom_device_t random_device_t }:chr_file { getattr read ioctl };
 
 # Transition to user domains for user sessions.
types.fc renamed from usr/src/se/policy/file_contexts/types.fc +0 -5
@@ -302,11 +299,6 @@
 /etc/resolv\.conf.*	--	system_u:object_r:net_conf_t
 
 /etc/selinux(/.*)?		system_u:object_r:selinux_config_t
-/etc/security/selinux(/.*)?	system_u:object_r:policy_config_t	
-/etc/security/selinux/src(/.*)?	system_u:object_r:policy_src_t
-/etc/security/default_contexts.*	system_u:object_r:default_context_t
-/etc/services		--	system_u:object_r:etc_t
-
 /etc/selinux/[^/]*/policy(/.*)?	system_u:object_r:policy_config_t
 /etc/selinux/[^/]*/src(/.*)?	system_u:object_r:policy_src_t
 /etc/selinux/[^/]*/contexts(/.*)?	system_u:object_r:default_context_t
program/portmap.fc renamed from usr/src/se/policy/file_contexts/program/portmap.fc +5 -0
@@ -1,4 +1,9 @@
 # portmap
 /sbin/portmap		--	system_u:object_r:portmap_exec_t
+ifdef(`distro_debian', `
+/sbin/pmap_dump		--	system_u:object_r:portmap_helper_exec_t
+/sbin/pmap_set		--	system_u:object_r:portmap_helper_exec_t
+', `
 /usr/sbin/pmap_dump	--	system_u:object_r:portmap_helper_exec_t
 /usr/sbin/pmap_set	--	system_u:object_r:portmap_helper_exec_t
+')
#1 lore raw

Merged.

This chunk is not needed because this rule occurs earlier in rpm's policy.

domains/program/unused/rpm.te 2004-11-22 03:14:43.000000000 +1100 renamed from usr/src/se/policy/domains/program/unused/rpm.te 2004-11-21 21:51:14.000000000 +1100 +5 -0
@@ -66,6 +66,11 @@
 domain_auto_trans(rpm_script_t, cupsd_exec_t, cupsd_t)
 ')
 
+ifdef(`gpg.te', `
+# gpg wants this so it does not dump core on errors
+allow rpm_t self:process { setrlimit };
+')
+
 # for a bug in rm
 dontaudit initrc_t pidfile:file write;
 
Quoted 25 lines · Russell Coker

udev.diff just combines a couple of lines into a single line.

diff changes the Makefile to have it not run setfiles -q needlessly (good for when a script runs "make install" a few hundred times).

Adds a couple of lines to assert.te.

Adds hide_broken_symptoms to ldconfig.te (there is no good cause for ldconfig_t to access a TCP socket).

Changes ftpd.te to allow access to home_root_t for the case of NFS root. This means that if you have home directories individually mounted on /home/user then things will still work (and there's no harm in granting such access).

Added some extra access that seems to be needed by the latest version of howl.

Removed the memory_device_t commend from xdm.te - we should not need to re-enable that.

Removed redundant entries from types.fc relating to the old locations before /etc/selinux was used.

Add support for the Debian locations for pmap_dump and pmap_set. I wonder whether those files will have to change locations in other distributions for the case of /usr on NFS...

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.