shlib_t vs lib_t for symbolic links
Is there any reason why the symbolic links under /lib and /usr/lib have type shlib_t instead of lib_t?
I've looked through the policy for different access for those types. I found three examples, there's user_ssh_t etc (which is a minor policy bug that I've fixed), there's apt_t (which may not be what we desire, but as apt_t can destroy your system in many ways that are easier than fiddling with sym-links it's not an issue), and there's the ldconfig_t policy for keeping the sym-links in shlib_t.
It seems that it would be simpler to have the sym-links in question have type lib_t, and with the current implementation there's no difference in access.
The reason I ask is that it would simplify things a bit (less policy in ldconfig.te and a possibility of optimising setfiles) to give the sym-links lib_t.
If there are any plans to do things differently in regard to lib_t/shlib_t in the future then I think that now would be a good time to discuss them.
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.
Quoted 2 lines · Russell Coker
Is there any reason why the symbolic links under /lib and
/usr/libhave typeshlib_tinstead oflib_t?
No, this is just a result of the types.fc entries for shared object (.so) files not being limited to regular files.
As a side note, for least privilege, it would be good to split up shlib_t and bind specific programs to executing specific shared objects, particularly for programs that are privileged.
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- 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 Smalley
Quoted 2 lines · Russell Coker
Is there any reason why the symbolic links under /lib and
/usr/libhave typeshlib_tinstead oflib_t?No, this is just a result of the types.fc entries for shared object (.so) files not being limited to regular files.
OK, that's already fixed. ;)
I've just gone through the file_contexts tree, specified the type of every entry where it was possible to do so, I've tested about the core stuff and I'll test most of the rest tomorrow (apart from things like vmware which I don't use).
Quoted 3 lines
As a side note, for least privilege, it would be good to split up
shlib_tand bind specific programs to executing specific shared objects, particularly for programs that are privileged.
Do you have any particular examples in mind?
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.