Skip to contentSkip to conversation

sigchld for sshd_t

DISCUSSION Russell Coker 2 participants 2 messages Sep 22, 2002 – Sep 23, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

avc: denied { sigchld } for pid=30758 exe=/usr/sbin/sshd scontext=root:user_r:newrole_t tcontext=system_u:system_r:sshd_t tclass=process

I ssh'd into a machine and ran "exec newrole -r sysadm_r" to do some administration work.

Then when I finished that I typed "exit" to end my shell, and the ssh connection was not closed as newrole_t did not have permission to send sigchld to sshd_t (I had to use "~.").

The same avc message can be generated by using newrole to change role/domain and then doing "exec gpg" or "exec netscape", however newrole is sleeping on wait() so it doesn't cause any operational issues.

I thought of allowing programs to send sigchld to privrole, but that would also include run_init_t and xdm_t.

I think that perhaps we need a new attribute for such things, maybe "login_parent", and then have:
allow domain_name login_parent:process sigchld;

In the appropriate places for $1_gpg_t, $1_netscape_t, newrole_t, etc.

Then the login attribute will be posessed by login_t, sshd_t, newrole_t, and crond_t.

Hmm, how dangerous is sending sigchld to crond_t or other similar programs anyway? Forcing netscape to do whatever I want is trivial, so this would allow me as user_t to send sigchld to any of those programs.

Russell Coker

--
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
Quoted 7 lines · Russell Coker

avc: denied { sigchld } for pid=30758 exe=/usr/sbin/sshd scontext=root:user_r:newrole_t tcontext=system_u:system_r:sshd_t tclass=process

I ssh'd into a machine and ran "exec newrole -r sysadm_r" to do some administration work.

Quoted 7 lines

Then when I finished that I typed "exit" to end my shell, and the ssh connection was not closed as newrole_t did not have permission to send sigchld to sshd_t (I had to use "~.").

The same avc message can be generated by using newrole to change role/domain and then doing "exec gpg" or "exec netscape", however newrole is sleeping on wait() so it doesn't cause any operational issues.

Naturally, this wouldn't be a problem if you ran newrole (or gpg or netscape) in a child process of the shell rather than using 'exec' to replace the shell. In that case, the existing rules would permit sigchld as needed. Is such usage of 'exec' common?

Quoted 3 lines

Hmm, how dangerous is sending sigchld to crond_t or other similar programs anyway? Forcing netscape to do whatever I want is trivial, so this would allow me as user_t to send sigchld to any of those programs.

The default action for SIGCHLD is to ignore the signal, and I would expect that explicit handlers for SIGCHLD would be relatively benign even when a spurious SIGCHLD is received. So it is likely not a big deal to grant sigchld permission.

--
Stephen D. Smalley, NAI Labs
[email protected]

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