Hide Forgot
Created attachment 1222149 [details] my-snapperd.te Description of problem: Some minutes after I login to my PC I always get snapperd errors from SELinux. Version-Release number of selected component (if applicable): snapper-0.3.3-1.fc25.x86_64 How reproducible: Steps to Reproduce: 1.Start PC and wait some minutes. 2. 3. Actual results: see example attachment Expected results: No SELinux errors. Additional info: I always do this: ausearch -c 'snapperd' --raw | audit2allow -M my-snapperd semodule -i my-snapperd.pp but this does not help. Next time I start my PC I get the next error. I also tried "restorecon -R -v /home" and on all other mountpoints - with no success.
*** Bug 1396727 has been marked as a duplicate of this bug. ***
Created attachment 1222151 [details] some examples for this issue
Created attachment 1222152 [details] ausearch -i | grep avc | grep snapper
Created attachment 1222153 [details] ausearch -i -c snapperd
It seems to me to be an issue with policy. I see objects in /home/.snapshots/ subdirectory labeled as 'user_home_dir_t' type instead of expected 'snapperd_t'. Any ideas?
(In reply to Ondrej Kozina from comment #5) > ...instead of expected 'snapperd_t'. Typo. It should have been 'snapperd_data_t'
[root@bat ~] # restorecon -R -v /home/.snapshots/1/snapshot restorecon reset /home/.snapshots/1/snapshot context system_u:object_r:home_root_t:s0->system_u:object_r:user_home_t:s0 restorecon set context /home/.snapshots/1/snapshot->system_u:object_r:user_home_t:s0 failed:'Read-only file system' I see two issues: - restorecon is trying to set the context to system_u:object_r:user_home_t:s0. I see nothing of type snapperd_data_t here. - Even this fails because of a 'Read-only file system'. /home is not mounted with ro flag. [root@bat ~] # btrfs sub list -p /home ID 277 gen 199127 parent 5 top level 5 path .snapshots ID 1342 gen 155521 parent 277 top level 277 path .snapshots/1/snapshot ID 1346 gen 156730 parent 277 top level 277 path .snapshots/5/snapshot ID 1428 gen 171664 parent 277 top level 277 path .snapshots/87/snapshot After I have done this: btrfs property set -ts /home/.snapshots/1/snapshot ro false I was able to run restorecon -R -v /home/.snapshots/1/snapshot But as mentioned before the type is not set to snapperd_data_t. Also the question is: is it correct that the snapshots are read-only or a mistake? Can you please bring some light into this?
Numbered subdirectories in .snapshots are read-only snapshots of /home (read-write) filesystem. This is expected. Snapper takes read-only snapshots solely. On the other hand a user_home_dir_t selinux type inside .snapshots directory is imo bug/mistake in policy.
OK - but this policy is nothing the user configures. So if the policy is wrong it should effect all users. Or is this a wrong conclusion?
What does all this mean now? How can I get rid of these alarms coming all the time?
Provided I was right about bug in policy, selinux team would need to update it so that it allows snapperd to access its metadata in '.snapshots' directory. You may also flip the selinux module to run in permissive mode, but this depends mostly on what do you run your Fedora installation on. If it's publicly exposed server I'd not recommend turning SElinux into permissive mode. Look for "selinux permissive mode" or run 'setenforce 0' as root to enable it until next reboot.
(Permissive mode would not get you rid of error messages but it'll allow snapperd to access its mda again)
OK- so I hope this policy will be fixed soon.
This message is a reminder that Fedora 25 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '25'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 25 is 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 change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. 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.
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.