All of lore.kernel.org
 help / color / mirror / Atom feed
* targeted policy patch
@ 2005-05-19 15:11 Serge Hallyn
  2005-05-19 15:29 ` Stephen Smalley
  0 siblings, 1 reply; 5+ messages in thread
From: Serge Hallyn @ 2005-05-19 15:11 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

Hi,

In order to compile the sf.net targeted policy on a gentoo system with
the sf.net checkpolicy, I needed the following patch.  It does several
small things, the last of which I expect is actually wrong, but at
least gets me a compiling policy:

1. preserves kernel.te to get its type declaration.
2. fixes what i assume is a type, 'rm -rf domains/misc/used' instead of unused
3. deletes setfiles.fc, since setfiles_exec_t is not declared in the policy
4. adds the unrestricted attribute to the insmod_t domain.  This stops
a conflict with the neverallow rule for ~signal -> unconfined_t.

thanks,
-serge

[-- Attachment #2: targeted_nits.patch --]
[-- Type: application/octet-stream, Size: 1883 bytes --]

Index: policy/selinux-policy-targeted.spec
===================================================================
--- policy.orig/selinux-policy-targeted.spec	2005-05-19 09:56:03.000000000 -0500
+++ policy/selinux-policy-targeted.spec	2005-05-19 09:57:28.000000000 -0500
@@ -48,8 +48,10 @@
 for i in amanda.te apache.te chkpwd.te cups.te dhcpd.te dictd.te dovecot.te fingerd.te ftpd.te howl.te i18n_input.te init.te initrc.te inetd.te innd.te kerberos.te ktalkd.te ldconfig.te login.te lpd.te mailman.te modutil.te mta.te mysqld.te named.te nscd.te ntpd.te portmap.te postgresql.te privoxy.te radius.te radvd.te rlogind.te rpcd.te rshd.te rsync.te samba.te slapd.te snmpd.te spamd.te squid.te stunnel.te syslogd.te telnetd.te tftpd.te winbind.te ypbind.te ypserv.te zebra.te; do
 mv domains/program/unused/$i domains/program/ 
 done 
+cp domains/misc/unused/kernel.te domains/misc
 rm -rf domains/program/unused 
-rm -rf domains/misc/used 
+rm -rf domains/misc/unused 
+rm file_contexts/program/setfiles.fc
 cp -R %{type}/* .
 echo "define(\`targeted_policy')"  > tunables/tunable.tun
 echo "define(\`hide_broken_symptoms')"  >> tunables/tunable.tun
Index: policy/domains/program/modutil.te
===================================================================
--- policy.orig/domains/program/modutil.te	2005-05-19 09:56:03.000000000 -0500
+++ policy/domains/program/modutil.te	2005-05-19 09:58:17.000000000 -0500
@@ -70,7 +70,7 @@
 # Rules for the insmod_t domain.
 #
 
-type insmod_t, domain, privlog, sysctl_kernel_writer, privmem, privsysmod ifdef(`unlimitedUtils', `, admin, etc_writer, fs_domain, auth_write, privowner, privmodule' )
+type insmod_t, domain, unrestricted, privlog, sysctl_kernel_writer, privmem, privsysmod ifdef(`unlimitedUtils', `, admin, etc_writer, fs_domain, auth_write, privowner, privmodule' )
 ;
 role system_r types insmod_t;
 role sysadm_r types insmod_t;

^ permalink raw reply	[flat|nested] 5+ messages in thread
* targeted policy patch
@ 2006-12-05 12:42 Russell Coker
  2006-12-08 13:39 ` Christopher J. PeBenito
  0 siblings, 1 reply; 5+ messages in thread
From: Russell Coker @ 2006-12-05 12:42 UTC (permalink / raw)
  To: SE-Linux; +Cc: Manoj Srivastava

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

The attached patch is needed to quiet mdadm (and programs that do similar 
things) for the case of unlabeled device nodes.  In Debian a typical install 
of etch with SE Linux will result in /dev/.static/dev containing a lot of 
unlabeled device nodes from the root filesystem (through a bind mount).

As for device_t, that's the default type upon creation and the type that new 
device nodes get before we assign a type to them.

-- 
russell@coker.com.au
http://etbe.blogspot.com/          My Blog

http://www.coker.com.au/sponsorship.html Sponsoring Free Software development

[-- Attachment #2: diff --]
[-- Type: text/x-diff, Size: 745 bytes --]

--- modules/kernel/devices.if.orig	2006-12-05 23:35:28.000000000 +1100
+++ modules/kernel/devices.if	2006-12-05 23:38:55.000000000 +1100
@@ -598,9 +598,11 @@
 interface(`dev_dontaudit_getattr_all_blk_files',`
 	gen_require(`
 		attribute device_node;
+		type file_t;
+		type device_t;
 	')
 
-	dontaudit $1 device_node:blk_file getattr;
+	dontaudit $1 { device_node file_t device_t }:blk_file getattr;
 ')
 
 ########################################
@@ -616,9 +618,11 @@
 interface(`dev_getattr_all_chr_files',`
 	gen_require(`
 		attribute device_node;
+		type file_t;
+		type device_t;
 	')
 
-	allow $1 device_node:chr_file getattr;
+	allow $1 { device_node file_t device_t }:chr_file getattr;
 ')
 
 ########################################

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-08 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19 15:11 targeted policy patch Serge Hallyn
2005-05-19 15:29 ` Stephen Smalley
2005-05-19 15:54   ` Serge Hallyn
  -- strict thread matches above, loose matches on Subject: below --
2006-12-05 12:42 Russell Coker
2006-12-08 13:39 ` Christopher J. PeBenito

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.