Bug 1465729
Summary: | SELinux is preventing snapperd from 'relabelfrom' accesses on the file info.xml. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Mike Goodwin <mike> |
Component: | selinux-policy | Assignee: | Lukas Vrabec <lvrabec> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 25 | CC: | bugzilla, dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, pmoore, rodrigoquesada.dev, ssekidde |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | abrt_hash:d8b044c4b7ff8b3cee8da8dabce03e8050cf7ef9530280baf0cdd41f391e0996; | ||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-12-12 10:30:35 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Mike Goodwin
2017-06-28 04:18:29 UTC
So here is the `sudo ausearch -c snapper | audit2allow` output after setting SELinux permissive. Bear in mind that the tool snapper is the one creating those files initially anyway, so in theory they should not be mislabled? #============= snapperd_t ============== allow snapperd_t self:capability fowner; allow snapperd_t snapperd_data_t:dir relabelfrom; allow snapperd_t snapperd_data_t:file relabelfrom; #!!!! The file '/.snapshots' is mislabeled on your system. #!!!! Fix with $ restorecon -R -v /.snapshots #!!!! This avc is a constraint violation. You would need to modify the attributes of either the source or target types to allow this access. #Constraint rule: # constrain dir { create relabelfrom relabelto } ((u1 == u2 -Fail-) or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED # Possible cause is the source user (system_u) and target user (unconfined_u) are different. # Possible cause is the source level (s0-s0:c0.c1023) and target level (s0) are different. allow snapperd_t user_home_dir_t:dir relabelto; allow snapperd_t user_home_dir_t:dir create; allow snapperd_t user_home_dir_t:file { create rename write }; #!!!! This avc is a constraint violation. You would need to modify the attributes of either the source or target types to allow this access. #Constraint rule: # constrain dir { create relabelfrom relabelto } ((u1 == u2 -Fail-) or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED # Possible cause is the source user (system_u) and target user (unconfined_u) are different. # Possible cause is the source level (s0-s0:c0.c1023) and target level (s0) are different. allow snapperd_t user_home_t:dir relabelto; allow snapperd_t user_home_t:file relabelto; Hi, I submitted a PR that addresses this issue (and also BZ-1180876, partially) some weeks ago, perhaps someone can review it and merge it to the appropriate branch? Fortunately, the issue was simple to solve, the problem was the context definitions for the home directory were wrong; they were simply not using the HOME_ROOT variable (and therefore they were not being moved to the file_contexts.homedirs file which has a "higher priority" than the file_contexts file). PR: https://github.com/fedora-selinux/selinux-policy-contrib/pull/19 Thank you. Aug 02 18:00:04 f26s.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=snapper-timeline comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Aug 02 18:00:05 f26s.localdomain dbus-daemon[663]: [system] Activating service name='org.opensuse.Snapper' requested by ':1.798' (uid=0 pid=14446 comm="/usr/libexec/snapper/systemd-helper --timeline " label="system_u:system_r:unconfined_service_t:s0") (using servicehelper) Aug 02 18:00:05 f26s.localdomain audit[14450]: AVC avc: denied { relabelto } for pid=14450 comm="snapperd" name="info.xml" dev="dm-4" ino=258 scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_t:s0 tclass=file permissive=0 Aug 02 18:00:05 f26s.localdomain audit[14450]: AVC avc: denied { create } for pid=14450 comm="snapperd" name="2" scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_t:s0 tclass=dir permissive=0 Aug 02 18:00:05 f26s.localdomain systemd[1]: snapper-timeline.service: Main process exited, code=exited, status=1/FAILURE Aug 02 18:00:05 f26s.localdomain systemd[1]: snapper-timeline.service: Unit entered failed state. Aug 02 18:00:05 f26s.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=snapper-timeline comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed' Aug 02 18:00:05 f26s.localdomain systemd[1]: snapper-timeline.service: Failed with result 'exit-code'. Aug 02 18:00:45 f26s.localdomain setroubleshoot[14453]: SELinux is preventing snapperd from relabelto access on the file info.xml. For complete SELinux messages run: sealert -l 0ba67353-c577-469a-bfb8-22785e525a0c Aug 02 18:00:45 f26s.localdomain python3[14453]: SELinux is preventing snapperd from relabelto access on the file info.xml. If you want to allow snapperd to have relabelto access on the info.xml file If you believe that snapperd should be allowed relabelto access on the info.xml file by default. # ausearch -c 'snapperd' --raw | audit2allow -M my-snapperd # semodule -X 300 -i my-snapperd.pp Except these two commands do not resolve the problem, error remains. Relabling doesn't fix it either. selinux-policy-3.13.1-260.3.fc26.noarch snapper-0.5.0-1.fc26.x86_64 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. |