fixfiles and lost+found
The patch named "diff" makes /tmp/lost+found immutable on a "fixfiles relabel" operation to avoid removing it. If /tmp is a mount point for an Ext3 file system then something equivalent to this is needed to avoid removing the /tmp/lost+found directory. Another option might be to recreate the lost+found directory afterwards, not sure if we want to be recreating it in that manner though.
The patch named "types.diff" adds /var/tmp to the list of directories that are likely to be mount points. Also it causes files/directories under the lost+found directory not to be relabeled. I think that it's fairly important not to relabel such objects, in many cases objects under the lost+found directory lose their name and determining the correct security context will be unreasonably difficult.
If we assume that file system corruption is going to either leave the security context unchanged or remove it entirely (not change the security context) then it MIGHT be acceptable for the administrator to move files from lost+found to a directory that is accessable for users who are granted access by SE Linux to the files in question. Then only files of type file_t would need to be manually sorted out.
In any case I'm quite sure that no benefit will be achieved by labelling objects under the lost+found directory. As objects are placed there in single user mode (IE no program has an open file handle) and only the administrator can descend the directory tree the permissions on the top level directory should be enough to control access.
Neither of these patches should be immediately applied, we probably need a discussion on both. Of course if no-one makes any comments then we can just assume that everyone agrees. ;)
Signature · 4 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
sbin/fixfiles renamed from sbin/fixfiles.orig +2 -0
@@ -124,7 +124,9 @@ fullrelabel() { logit "Cleaning out /tmp" + test -d /tmp/lost+found && chattr +i /tmp/lost+found rm -rf /tmp/.??* /tmp/* + test -d /tmp/lost+found && chattr -i /tmp/lost+found LogReadOnly restore }
types.fc renamed from types.fc.orig +16 -7
@@ -439,13 +439,22 @@ # # Lost and found directories. # -/lost\+found(/.*)? system_u:object_r:lost_found_t -/usr/lost\+found(/.*)? system_u:object_r:lost_found_t -/boot/lost\+found(/.*)? system_u:object_r:lost_found_t -HOME_ROOT/lost\+found(/.*)? system_u:object_r:lost_found_t -/var/lost\+found(/.*)? system_u:object_r:lost_found_t -/tmp/lost\+found(/.*)? system_u:object_r:lost_found_t -/usr/local/lost\+found(/.*)? system_u:object_r:lost_found_t +/lost\+found -d system_u:object_r:lost_found_t +/lost\+found/.* <<none>> +/usr/lost\+found -d system_u:object_r:lost_found_t +/usr/lost\+found/.* <<none>> +/boot/lost\+found -d system_u:object_r:lost_found_t +/boot/lost\+found/.* <<none>> +/HOME_ROOT/lost\+found -d system_u:object_r:lost_found_t +/HOME_ROOT/lost\+found/.* <<none>> +/var/lost\+found -d system_u:object_r:lost_found_t +/var/lost\+found/.* <<none>> +/tmp/lost\+found -d system_u:object_r:lost_found_t +/tmp/lost\+found/.* <<none>> +/var/tmp/lost\+found -d system_u:object_r:lost_found_t +/var/tmp/lost\+found/.* <<none>> +/usr/local/lost\+found -d system_u:object_r:lost_found_t +/usr/local/lost\+found/.* <<none>> # # system localization
Quoted 6 lines · Russell Coker
The patch named "types.diff" adds
/var/tmpto the list of directories that are likely to be mount points. Also it causes files/directories under the lost+found directory not to be relabeled. I think that it's fairly important not to relabel such objects, in many cases objects under the lost+found directory lose their name and determining the correct security context will be unreasonably difficult.
I made a minor mistake in the first version of types.diff, I have attached a corrected version.
Signature · 4 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
types.fc renamed from types.fc.orig +16 -7
@@ -439,13 +439,22 @@ # # Lost and found directories. # -/lost\+found(/.*)? system_u:object_r:lost_found_t -/usr/lost\+found(/.*)? system_u:object_r:lost_found_t -/boot/lost\+found(/.*)? system_u:object_r:lost_found_t -HOME_ROOT/lost\+found(/.*)? system_u:object_r:lost_found_t -/var/lost\+found(/.*)? system_u:object_r:lost_found_t -/tmp/lost\+found(/.*)? system_u:object_r:lost_found_t -/usr/local/lost\+found(/.*)? system_u:object_r:lost_found_t +/lost\+found -d system_u:object_r:lost_found_t +/lost\+found/.* <<none>> +/usr/lost\+found -d system_u:object_r:lost_found_t +/usr/lost\+found/.* <<none>> +/boot/lost\+found -d system_u:object_r:lost_found_t +/boot/lost\+found/.* <<none>> +HOME_ROOT/lost\+found -d system_u:object_r:lost_found_t +HOME_ROOT/lost\+found/.* <<none>> +/var/lost\+found -d system_u:object_r:lost_found_t +/var/lost\+found/.* <<none>> +/tmp/lost\+found -d system_u:object_r:lost_found_t +/tmp/lost\+found/.* <<none>> +/var/tmp/lost\+found -d system_u:object_r:lost_found_t +/var/tmp/lost\+found/.* <<none>> +/usr/local/lost\+found -d system_u:object_r:lost_found_t +/usr/local/lost\+found/.* <<none>> # # system localization
Quoted 9 lines
fullrelabel(){
logit "Cleaning out /tmp"sbin/fixfiles renamed from sbin/fixfiles.orig +2
-0+ test -d /tmp/lost+found && chattr +i /tmp/lost+found rm -rf /tmp/.??* /tmp/* + test -d /tmp/lost+found && chattr -i /tmp/lost+found LogReadOnly restore}
Shouldn't this have a trap statement in case its gets terminated after making it immutable and before putting it back?
-Steve Grubb
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
--
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.