polyinstantiating /tmp and gdm
Hi Dan,
I have figured out a way to get gdm/X to work with a polyinstantiated /tmp. In my previous attempts I was bind mounting original /tmp/.X11-unix on /instance/.X11-unix and then expecting the socket to be visible after bind mounting the instance on the original /tmp. Now I understand why that doesn't work. What we need is to make the original /tmp (or in our case just the /tmp/.X11-unix) available from alternative location outside of /tmp before it is mounted over. If you remember, this was in Stephen's original design but we removed it because we couldn't find any use for it. Now we have :-). This is still a very specific use, so I am going to special case it with instance.init script and NOT bring back the "original" directory code that was present in the earlier incarnation of the pam_namespace. The only change to pam_namespace module will be to always execute the instance.init script as opposed to only at the time of the instance creation.
I have to finish some lspp stuff today, but I will try and send out an updated patch with modified pam_namespace, instance.init and man pages by tomorrow.
Thanks.
-Janak
--
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.
Quoted 6 lines · Janak Desai
I have figured out a way to get gdm/X to work with a polyinstantiated /tmp. In my previous attempts I was bind mounting original
/tmp/.X11-unixon /instance/.X11-unix and then expecting the socket to be visible after bind mounting the instance on the original /tmp. Now I understand why that doesn't work. What we need is to make the original /tmp (or in our case just the/tmp/.X11-unix) available from alternative location
Quoted 8 lines
outside of /tmp before it is mounted over. If you remember, this was in Stephen's original design but we removed it because we couldn't find any use for it. Now we have :-). This is still a very specific use, so I am going to special case it with instance.init script and NOT bring back the "original" directory code that was present in the earlier incarnation of the
pam_namespace. The only change topam_namespacemodule will be to always execute the instance.init script as opposed to only at the time of the instance creation.
We seem to be spending a lot of effort on supporting what was always a bad idea (putting such things under /tmp).
Maybe a better option is to have the socket created under /var/run/.X11-unix and have /tmp/.X11-unix be a sym-link to /var/run/.X11-unix. Creating a new sym-link under each poly directory is less work than doing yet another mount. Note that this doesn't only apply to .X11-unix, there's .font-unix as well and probably some other daemons out there doing other things.
Signature · 9 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 -- 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.
Quoted 16 lines · Russell Coker
Quoted 6 lines · Janak Desai
I have figured out a way to get gdm/X to work with a polyinstantiated /tmp. In my previous attempts I was bind mounting original
/tmp/.X11-unixon /instance/.X11-unix and then expecting the socket to be visible after bind mounting the instance on the original /tmp. Now I understand why that doesn't work. What we need is to make the original /tmp (or in our case just the/tmp/.X11-unix) available from alternative locationQuoted 8 lines
outside of /tmp before it is mounted over. If you remember, this was in Stephen's original design but we removed it because we couldn't find any use for it. Now we have :-). This is still a very specific use, so I am going to special case it with instance.init script and NOT bring back the "original" directory code that was present in the earlier incarnation of the
pam_namespace. The only change topam_namespacemodule will be to always execute the instance.init script as opposed to only at the time of the instance creation.
Quoted 9 lines
We seem to be spending a lot of effort on supporting what was always a bad idea (putting such things under /tmp).
Maybe a better option is to have the socket created under
/var/run/.X11-unixand have/tmp/.X11-unixbe a sym-link to/var/run/.X11-unix. Creating a new sym-link under each poly directory is less work than doing yet another mount. Note that this doesn't only apply to .X11-unix, there's .font-unix as well and probably some other daemons out there doing other things.
Yes, I agree. Is there an X server config option that allows us to do this? I looked for it but couldn't figure out a way to make X not use /tmp.
-Janak
--
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.
Quoted 10 lines · --- Russell Coker
Maybe a better option is to have the socket created under
/var/run/.X11-unix
and have/tmp/.X11-unixbe a sym-link to/var/run/.X11-unix. Creating a new
sym-link under each poly directory is less work than doing yet another mount.
Note that this doesn't only apply to .X11-unix, there's .font-unix as well
and probably some other daemons out there doing other things.
Each of that daemons is going to have to
enforce (at least) MLS if you do this. While
this does make sense for the more sophisticated
programs (MLS X11 has been done, but my
recollections from the 1st SELinux forum was
that doing it again wasn't on anyone's list)
it is not a good notion for the little dumb
services.
The state of labeled networking is still a
bit rough for implementing policy enforcing
daemons.
Casey Schaufler
[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.
Quoted 8 lines · Casey Schaufler
Quoted 2 lines · --- Russell Coker
Maybe a better option is to have the socket created under
/var/run/.X11-unixEach of that daemons is going to have to enforce (at least) MLS if you do this. While this does make sense for the more sophisticated programs (MLS X11 has been done, but my
You seem to be confusing separate issues here.
Changing the directory used as the parent of the directory containing the socket makes no difference. In either case the directory needs to have a low enough level that all the X programs can read it, and for both /tmp and /var/tmp there's a range of SystemLow-SystemHigh so there's no issue in that regard.
As for the issue of making the X server enforce MLS, isn't that part of the plan for security enhanced X?
Signature · 9 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 -- 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.
Quoted 6 lines · --- Russell Coker
Quoted 2 lines · Casey Schaufler
Quoted 1 line · --- Russell Coker
Maybe a better option is to have the socket
created
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
under
/var/run/.X11-unixEach of that daemons is going to have to enforce (at least) MLS if you do this. While this does make sense for the more sophisticated programs (MLS X11 has been done, but my
You seem to be confusing separate issues here.
Wouldn't be the first time.
Quoted 9 lines
Changing the directory used as the parent of the directory containing the
socket makes no difference. In either case the directory needs to have a low
enough level that all the X programs can read it, and for both /tmp
and/var/tmpthere's a range of SystemLow-SystemHigh so there's no issue in
that regard.
So long as the X server (or whatever server
you have) is policy enforcing this is true.
For SELinux there's a lot more to policy
than just MLS. My point is that if a process
in one domain can communicate with a process
in another domain through the server that's
Not Right.
If you put one .X11-unix in /var/run that
everyone opens the server must obtain the
security attributes explicitly for each client.
If you put a seperate .X11-unix in each
instance of /tmp you have the implicit
attributes found on the UDS.
... unless I missed the discussion wherein/var/run was polyinstantiated, in which case
nevermind.
Quoted 3 lines
As for the issue of making the X server
enforce MLS, isn't that part of the
plan for security enhanced X?
One would expect. The X server for SELinux is
going to have to enforce the entire policy,
not just MLS to pass a CC evaluation. Ah,
the joy of application objects.
Casey Schaufler
[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.