tmpfs_t
Quoted 8 lines
I have been looking into using tmpfs as /tmp .
Currently tmpfs is labeled
tmpfs_tand there is no policy for allowing file creation under it. So I have experimented with labelling it astmp_tand changing thetmp_domain()macro to have the following rule:
allow $1_tmp_t tmp_t:filesystem associate;
Quoted 7 lines
To do this properly I would also have to change every allow whatever fs_t:filesystem getattr;
to:
allow whatever {fs_ttmp_t}:filesystem getattr;Or should I instead leave the tmpfs filesystem labelled as
tmpfs_tand add appropriatefile_type_auto_trans()rules for it?
The problem is that tmpfs is also used for the kernel internal mount for System V shared memory and shared anonymous mappings. The current fs_use configuration and the existing $1_tmpfs_t types and rules are oriented toward that usage of tmpfs. Distinguishing different instances of tmpfs mounts and providing different labeling behaviors and contexts for those different instances would require further changes to SELinux.
--
Stephen Smalley, NSA
[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 6 lines · Stephen D. Smalley
The problem is that tmpfs is also used for the kernel internal mount for System V shared memory and shared anonymous mappings. The current
fs_useconfiguration and the existing $1_tmpfs_t types and rules are oriented toward that usage of tmpfs. Distinguishing different instances of tmpfs mounts and providing different labeling behaviors and contexts for those different instances would require further changes to SELinux.
I believe that changes are required.
For UML and busy Apache servers using tmpfs as /tmp is common practise. The current SE Linux setup will force many of the people who run big servers to change their operation in a way that will hurt performance to support running SE Linux.
I've experimented with using chcon to set the type after mounting which seems to work OK.
I believe that the best option is to label the root inode of tmpfs as system_u:object_r:tmp_t via initial_sid_contexts. I've been looking at the kernel code, is superblock_doinit() the right place to do a change?
Signature · 10 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.
SELinux question?
Why are certain applications (ls, cp, cd) ported to use SELinux with the standard names, while others (spasswd, schfn) have a prefix added?
Dan
--
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.
Re: SELinux question?
Quoted 3 lines · Daniel J Walsh
Why are certain applications (ls, cp, cd) ported to use SELinux with the standard names, while others
(spasswd, schfn) have a prefix added?
ls, ps and others are modified versions of the originals.
spasswd, and the other s* programs are wrappers around the original tools. For various reasons, this was the only or better way of making them SE-aware in those cases.
Signature · 8 lines
PGP/GPG key: http://web.lemuria.org/pubkey.html pub 1024D/2D7A04F5 2002-05-16 Tom Vogt <[email protected]> Key fingerprint = C731 64D1 4BCF 4C20 48A4 29B2 BF01 9FA1 2D7A 04F5 -- 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.
Re: SELinux question?
Quoted 8 lines · Tom
Quoted 4 lines · Daniel J Walsh
Why are certain applications (ls, cp, cd) ported to use SELinux with the standard names, while others (spasswd, schfn) have a prefix added?
Quoted 10 lines
ls, ps and others are modified versions of the originals.
spasswd, and the other s* programs are wrappers around the original tools. For various reasons, this was the only or better way of making them SE-aware in those cases.
So they did it because it was easier to wrap the application then to change the code, correct?
In the other cases they could not wrap the apps so they went in and changed the code. I would like to know if there was any other reason to use the s* syntax, or all things being equil you would replace the passwd command with a SELinux aware passwd command?
Dan
Dan
Re: SELinux question?
Quoted 2 lines · Daniel J Walsh
So they did it because it was easier to wrap the application then to change the code, correct?
Yes. Changing the application requires keeping up to date with new versions of the application (on-going work) and also it's easy to make a mistake when working with someone else's uncommented code.
For some things it's necessary, EG changing the login programs and cron because the change is so tightly related to the task. For some things it doesn't make sense to try and wrap it (EG ls).
For some programs such as passwd it's not something you want to get into yourself, it's easiest to write a wrapper, and there are a family of programs which can all be serviced by the same wrapper if done properly.
Quoted 3 lines
I would like to know if there was any other reason to use the s* syntax, or all things being equil
you would replace the passwd command with a SELinux aware passwd command?
The spasswd program is hard-coded to run /usr/bin/passwd, so if you rename it then you'll also have to change the code.
I could do such things quite easily for my Debian packaging of SE Linux programs, but the NSA are focusing on a tarball release which makes such things impractically difficult.
Signature · 10 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.
RE: SELinux question?
In reply to Daniel J WalshQuoted 3 lines
Why are certain applications (ls, cp, cd) ported to use SELinux with the standard names, while others
(spasswd, schfn) have a prefix added?
Look in selinux/utils/spasswd/README in the source distribution for an explanation
--
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.