Hide Forgot
SELinux is preventing /usr/sbin/fsarchiver from 'mac_admin' accesses on the capability2 Unknown. ***** Plugin catchall (100. confidence) suggests *************************** If you believe that fsarchiver should be allowed mac_admin access on the Unknown capability2 by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # grep fsarchiver /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Additional Information: Source Context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1 023 Target Context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1 023 Target Objects Unknown [ capability2 ] Source fsarchiver Source Path /usr/sbin/fsarchiver Port <Unknown> Host (removed) Source RPM Packages fsarchiver-0.6.11-1.fc15 Target RPM Packages Policy RPM selinux-policy-3.9.16-15.fc15 Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 2.6.38.2-9.fc15.x86_64 #1 SMP Wed Mar 30 16:55:57 UTC 2011 x86_64 x86_64 Alert Count 1 First Seen Thu 14 Apr 2011 09:28:39 AM PDT Last Seen Thu 14 Apr 2011 09:28:39 AM PDT Local ID 3e2ae9de-eb9a-4e61-947b-eeb84c76fdfd Raw Audit Messages type=AVC msg=audit(1302798519.816:247): avc: denied { mac_admin } for pid=21296 comm="fsarchiver" capability=33 scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=capability2 type=SYSCALL msg=audit(1302798519.816:247): arch=x86_64 syscall=lsetxattr success=no exit=EINVAL a0=7fffd2a69070 a1=7fffd2a67660 a2=7fffd2a57660 a3=20 items=0 ppid=20473 pid=21296 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=1 comm=fsarchiver exe=/usr/sbin/fsarchiver subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) Hash: fsarchiver,unconfined_t,unconfined_t,capability2,mac_admin audit2allow #============= unconfined_t ============== allow unconfined_t self:capability2 mac_admin; audit2allow -R #============= unconfined_t ============== allow unconfined_t self:capability2 mac_admin;
Why is fsarchiver trying to put down labels SELinux does not understand?
fsarchiver is a backup application that works at the file level. It preserves all file attributes including xattr. When files are restored it attempts to restore all xattr using lsetxattr. It it similar to what rsync does when option -X is used, and the same type of error have been reported: http://www.redhat.com/archives/fedora-selinux-list/2009-August/msg00073.html
Basically this will happen if you backup from a machine with SELinux policies/labels that are different from the machine you are restoring to. I would say fsarchive has a few options what to do when this happens. One refuse to restore the file, restore the file with the default label, ask SELinux what the label on the destination machine should be, and make it so. Option 3 is probably usually what the user would want. ( I am of the belief that saving the file context and restoring it even if the machine understands the labels, seldom what the user wants. In MLS environments yes, but in the case of backing up a home dir from a previous version of the OS to a new version, the user would prefer to have the labels match what the new OS would expect.
(In reply to comment #3) > Basically this will happen if you backup from a machine with SELinux > policies/labels that are different from the machine you are restoring to. I > would say fsarchive has a few options what to do when this happens. One refuse > to restore the file, restore the file with the default label, ask SELinux what > the label on the destination machine should be, and make it so. > > Option 3 is probably usually what the user would want. ( I am of the belief > that saving the file context and restoring it even if the machine understands > the labels, seldom what the user wants. > > In MLS environments yes, but in the case of backing up a home dir from a > previous version of the OS to a new version, the user would prefer to have the > labels match what the new OS would expect. But there is the case of moving the entire OS using fsarchiver. For example I booted a Fedora 16 livecd, created a backup of my (Fedora 16) system using fsarchiver and wrote the fs back on my SSD. That way I could move from it away from the mechanical driver even though the SSD was smaller. In that case I'd want the original labels to be preserved (which in that case happened but when the live environment and the OS do not match it might cause the above mentioned problems),
Was the F16 machine you were moving it to fully updated to the same version of policy that the backed up livecd had. Sadly we do not know what label was attempting to be placed on the machine, I think the latest F17 kernels show us the label, so we could figure out what was happening.
(In reply to comment #5) > Was the F16 machine you were moving it to fully updated to the same version of > policy that the backed up livecd had. No, the livecd had an older policy. > Sadly we do not know what label was attempting to be placed on the machine, I > think the latest F17 kernels show us the label, so we could figure out what was > happening. Well I am not sure my comment 4 was clear but there wasn't any problem there i.e it worked. I am just saying that just in case the policies do not match I'd expect it to work anyway i.e "put down labels SELinux does not understand". But a full relabel after the disk move might be a good idea anyway.
In this case it looks like fsarchiver puts the file down (and so the new inode is created with a default label of some sort) and then attempts to set the label using lsetxattr to what it was on the old box. This lsetxattr call failed. So the file is being restored, but it will not have the old label. I think (although I've been wrong hundreds of times before) that the kernel might be emitting a message either in dmesg or an SELINUX_ERR audit message (ausearch -i -m SELINUX_ERR) which might tell us this invalid label. I'm not sure what the 'right' solution for fsarchiver is. For partial system backup and restore the vast majority of the time people will want a valid label. For whole system backup I agree that you want the 'invalid' label. Is this something fsarchiver knows about? Would they be interested in adding more SELinux brains to the application? Maybe Dan can create a boolean to toggle its ability to set invalid labels and the application could know when users probably want one behavior or the other?
Thanks for your comments. At the moment fsarchiver knows nothing about selinux. All it does is it reads all files data and attributes (xattr) when we do a savefs (save filesystem) and it sets these attributes when we do a restfs (restore filesystem). It is possible for me to make simple modifications in the next fsarchiver release to fix this problem. I can add a new option to getopt_long so that fsarchiver allows the end user to decide what to do. For instance we could have an option such as "fsarchiver --ignore-setxattr-selinux" so that "fsarchiver restfs" ignores the lsetxattr() for selinux xattr. Or fsarchiver can use libselinux if it is not complicated to do specific things. But first I would like to be sure that we have a good solution that will make everybody happy and that will be consistent at all levels (selinux-policy packages, ...). I only have basic knowledge of selinux so you probably have a better idea of what the proper solution will be (adding new policies, adding options to fsarchiver, ...). Let me know if fsarchiver requires such changes and please give me the basic logic with examples if you think fsarchiver should use libselinux.
No that is not what we would want necessarily. Having SELinux built into the tools could put down the labels at file creation time. Or you could ask the machine what the default label for a given path should be, and set the path. Not putting down the labels, could potentially put down other problems.
This message is a notice that Fedora 15 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 15. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At this time, all open bugs with a Fedora 'version' of '15' have been closed as WONTFIX. (Please note: Our normal process is to give advanced warning of this occurring, but we forgot to do that. A thousand apologies.) Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, feel free to reopen this bug and simply change the 'version' to a later Fedora version. Bug Reporter: Thank you for reporting this issue and we are sorry that we were unable to fix it before Fedora 15 reached end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" (top right of this page) and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping