Bug 1458831
| Summary: | '/sbin/fixfiles restore' doesn't relabel all files when run from /.autorelabel or from system when some special files are present in /tmp | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Ondrej Faměra <ofamera> | 
| Component: | policycoreutils | Assignee: | Vit Mojzis <vmojzis> | 
| Status: | CLOSED ERRATA | QA Contact: | Dalibor Pospíšil <dapospis> | 
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.3 | CC: | cww, dapospis, dwalsh, fadamo, herrold, lvrabec, mgrepl, mmalik, ofamera, plautrba, rmetrich, ssekidde, vmojzis, zpytela | 
| Target Milestone: | rc | Keywords: | Reopened | 
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 16:36:29 UTC | Type: | Bug | 
| Regression: | --- | Mount Type: | --- | 
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1420851, 1469954 | ||
| 
 
        
          Description
        
        
          Ondrej Faměra
        
        
        
        
        
          2017-06-05 15:03:42 UTC
        
       
      
      
      
    SELinux does not define labels for most content in /tmp, so fixfiles/restore does not modify the labels. Any content labeled <<none>> will not be relabeled. It is always best to remove all files in /tmp. Or leave them with the label they had when they were moved there. Hi Dan, I think I haven't explained correctly which files are not getting labelled correctly. I agree that there is no point in concerning about files /tmp. However I'm referring here to files in system like /usr/bin/true or /usr/lib64/libcrypto.so.1.0.0 and many others that will not have a correct label after either running '/sbin/fixfile restore' or making 'touch /.autorelabel; reboot'. Is it expected behaviour that '/sbin/fixfiles restore' doesn't restore label on important system files in /usr/lib64 when some special files in /tmp are present and will exit with exit code '0'? Ondrej Yes fixfiles should fix the labels and not exit prematurely. (In reply to Ondrej Faměra from comment #3) > Hi Dan, > > I think I haven't explained correctly which files are not getting labelled > correctly. I agree that there is no point in concerning about files /tmp. > However I'm referring here to files in system like /usr/bin/true or > /usr/lib64/libcrypto.so.1.0.0 and many others that will not have a correct > label after either running '/sbin/fixfile restore' or making 'touch > /.autorelabel; reboot'. > > Is it expected behaviour that '/sbin/fixfiles restore' doesn't restore label > on important system files in /usr/lib64 when some special files in /tmp are > present and will exit with exit code '0'? > > Ondrej Thank you for reporting the issue. I wasn't able to follow the provided reproducer (ReaR restore procedure corrupted my virtual machine's boot loader), could you possibly grant me access to your machine, or better yet provide an example of "special file in /tmp" (file which makes fixfiles crash)? Turns out that fixfiles doesn't exit prematurely. The "special files" in /tmp contain symbolic links (including links to files in /usr/lib64). Last step of "fixfiles restore" procedure is labeling content of /tmp as tmp_t, which causes reported behaviour (some files in /usr/lib64 are labeled tmp_t because of the symbolic links). The fix was already approved upstream: https://github.com/SELinuxProject/selinux/commit/2608b4d6660af0fb8ad93f2cc144bdaab3c2afa8 *** Bug 1545664 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:0913  |