NSA SE enabled devfsd
Quoted 1 line · Russell Coker
I have hacked support for SE Linux into devfsd.
I have found one problem with my current code. devfsd wants to re-apply it's permissions to device nodes whenever it's restarted and whenever you do "killall -1 devfsd" to tell it to reload it's config.
During the course of a login session the SID of the pty device will change. It starts as devpts_t, goes to sshd_devpts_t (for a ssh session - an equivalent type for a non-ssh session), then goes to user_t (or an appropriate type for the user).
So if devfsd is restarted when someone is logged in then the result is likely to be a logout for them (which is tough if you've logged in to change the devfsd config).
Currently I've got my devfsd config matching on ^pts$ and using domain transition rules for the rest.
For the /dev/vc/* devices (devfs equivalent to /dev/tty[0-9]*) the only solution I get think of right now is to have the devfs_contexts file specify them.
Also this is not an issue that is restricted to SE Linux. Currently if I run "killall -1 devfsd" it will be equivalent to "mesg n" for all users!
Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines of legalistic junk at the end then you are specifically authorizing me to do whatever I wish with the message and all other messages from your domain, by posting the message you agree that your long legalistic sig is void. -- You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Richard Gooch
Quoted 6 lines
Quoted 1 line
I have hacked support for SE Linux into devfsd.
I have found one problem with my current code. devfsd wants to re-apply it's permissions to device nodes whenever it's restarted and whenever you do "killall -1 devfsd" to tell it to reload it's config.
I'm open to (clean) suggestions on what to do about this. Perhaps a separate signal to reload the config file but don't generate the synthetic events?
Sounds reasonable.
Quoted 4 lines
But before I make such a change, tell me why you're reloading the config file, but don't want to change permissions? Normally, you just send SIGHUP when /var is mounted (if that's where your permissions have been saved).
If you decide to change your policy or add support for some type of device node that was not previously supported then you have to reload the config.
Changing the policy does not necessarily require that existing permissions need to be changed.
Quoted 6 lines
Quoted 3 lines
Also this is not an issue that is restricted to SE Linux. Currently if I run "killall -1 devfsd" it will be equivalent to "mesg n" for all users!
But in general devfsd should be configured to *not* touch permissions for PTY's, so this shouldn't be a problem. What are you doing?
The following is in my devfsd.conf to change the group of the pts devices to group tty:
REGISTER ^pts/.* PERMISSIONS -1.tty 0600
Is there any better way to do this?
Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines of legalistic junk at the end then you are specifically authorizing me to do whatever I wish with the message and all other messages from your domain, by posting the message you agree that your long legalistic sig is void. -- You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.