Skip to contentSkip to conversation

next try at refpolicy-gentoo patches

PATCH Serge E. Hallyn 2 participants 4 messages Jan 19, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

The following set of patches lets me log in locally on a gentoo system in enforcing mode.

First, label the serial ports as tty devices:

policy/modules/kernel/terminal.fc +3 -0
Index: refpolicy/policy/modules/kernel/terminal.fc
===================================================================
@@ -24,3 +24,6 @@
 /dev/vcs[^/]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
 
 /dev/usb/tty.*		-c	gen_context(system_u:object_r:usbtty_device_t,s0)
+ifdef(`distro_gentoo', `
+/dev/tts/[0-9]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
+')

Second, unix_chkpwd is under /usr/sbin/ under gentoo:

policy/modules/system/authlogin.fc +5 -0
Index: refpolicy/policy/modules/system/authlogin.fc
===================================================================
@@ -12,6 +12,11 @@
 /sbin/pam_console_apply	 --	gen_context(system_u:object_r:pam_console_exec_t,s0)
 /sbin/pam_timestamp_check --	gen_context(system_u:object_r:pam_exec_t,s0)
 /sbin/unix_chkpwd	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)
+
+ifdef(`distro_gentoo', `
+/usr/sbin/unix_chkpwd	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)
+')
+
 /sbin/unix_verify	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)
 ifdef(`distro_suse', `
 /sbin/unix2_chkpwd	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)

Third, I need to send sighld from user_t to local_login_t on login, else I get an endless series of error messages on console (login: waitpid (6328, NULL, 0) failed: No child processes) Is this really gentoo-specific?

policy/modules/system/userdomain.if +4 -0
Index: refpolicy/policy/modules/system/userdomain.if
===================================================================
@@ -33,6 +33,10 @@ template(`base_user_template',`
 	role $1_r types $1_t;
 	allow system_r $1_r;
 
+	ifdef(`distro_gentoo',`
+		allow $1_t local_login_t:process { sigchld };
+	')
+
 	# user pseudoterminal
 	type $1_devpts_t;
 	term_user_pty($1_t,$1_devpts_t)

Lastly, like with redhat, /dev is tmpfs, so user terminals need to be able to associate with tmpfs.

policy/modules/kernel/terminal.if +3 -0
Index: refpolicy/policy/modules/kernel/terminal.if
===================================================================
@@ -88,6 +88,9 @@ interface(`term_tty',`
 		type_change $1 ttynode:chr_file $2;
 	')
 
+	ifdef(`distro_gentoo',`
+		fs_associate_tmpfs($2)
+	')
 	ifdef(`distro_redhat',`
 		fs_associate_tmpfs($2)
 	')

thanks,
-serge

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

#1 lore raw

Oops, I forgot one piece which was thrown in with a site-private patch.

Under gentoo, syslog-ng is under /usr/sbin.

policy/modules/system/logging.fc +3 -0
Index: refpolicy/policy/modules/system/logging.fc
===================================================================
@@ -10,6 +10,9 @@
 /sbin/minilogd		--	gen_context(system_u:object_r:syslogd_exec_t,s0)
 /sbin/syslogd		--	gen_context(system_u:object_r:syslogd_exec_t,s0)
 /sbin/syslog-ng		--	gen_context(system_u:object_r:syslogd_exec_t,s0)
+ifdef(`distro_gentoo', `
+/usr/sbin/syslog-ng		--	gen_context(system_u:object_r:syslogd_exec_t,s0)
+')
 
 /usr/sbin/klogd		--	gen_context(system_u:object_r:klogd_exec_t,s0)
 /usr/sbin/metalog	--	gen_context(system_u:object_r:syslogd_exec_t,s0)

thanks,
-serge

--
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 4 lines · Serge E. Hallyn

Oops, I forgot one piece which was thrown in with a site-private patch.

Under gentoo, syslog-ng is under /usr/sbin.

Merged.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.
#3 lore raw
In reply to Serge E. Hallyn
Quoted 2 lines · Serge E. Hallyn

The following set of patches lets me log in locally on a gentoo system in enforcing mode.

Merged, with one note,

Quoted 4 lines

Third, I need to send sighld from user_t to local_login_t on login, else I get an endless series of error messages on console (login: waitpid (6328, NULL, 0) failed: No child processes) Is this really gentoo-specific?

With some digging, and discussion in the IRC channel, this one wasn't Gentoo specific, and due to some missing IPC rules in the domain transition to all user domains that local_login_t was using. I fixed that, so this hunk isn't needed:

Quoted 15 lines

Index: refpolicy/policy/modules/system/userdomain.if
===================================================================

policy/modules/system/userdomain.if +4 -0
@@ -33,6 +33,10 @@ template(`base_user_template',`
 	role $1_r types $1_t;
 	allow system_r $1_r;
 
+	ifdef(`distro_gentoo',`
+		allow $1_t local_login_t:process { sigchld };
+	')
+
 	# user pseudoterminal
 	type $1_devpts_t;
 	term_user_pty($1_t,$1_devpts_t)
Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


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