RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1619356 - SELinux is preventing /usr/sbin/snapperd from using the dac_override capability.
Summary: SELinux is preventing /usr/sbin/snapperd from using the dac_override capability.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.6
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-20 15:17 UTC by Jakub Krysl
Modified: 2019-03-12 08:26 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-12 08:26:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jakub Krysl 2018-08-20 15:17:35 UTC
Description of problem:
# sealert -l 9860e8d4-c074-40d4-82a7-0c0ee560e88d
SELinux is preventing /usr/sbin/snapperd from using the dac_override capability.

*****  Plugin dac_override (91.4 confidence) suggests   **********************

If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
Then turn on full auditing to get path information about the offending file and generate the error again.
Do

Turn on full auditing
# auditctl -w /etc/shadow -p w
Try to recreate AVC. Then execute
# ausearch -m avc -ts recent
If you see PATH record check ownership/permissions on file, and fix it,
otherwise report as a bugzilla.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that snapperd should have the dac_override capability 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:
# ausearch -c 'snapperd' --raw | audit2allow -M my-snapperd
# semodule -i my-snapperd.pp


Additional Information:
Source Context                system_u:system_r:snapperd_t:s0-s0:c0.c1023
Target Context                system_u:system_r:snapperd_t:s0-s0:c0.c1023
Target Objects                Unknown [ capability ]
Source                        snapperd
Source Path                   /usr/sbin/snapperd
Port                          <Unknown>
Host                          *****
Source RPM Packages
Target RPM Packages
Policy RPM                    selinux-policy-3.13.1-210.el7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     *****
Platform                      *****
                              3.10.0-933.el7.x86_64 #1 SMP Sat Aug 11 11:32:57
                              EDT 2018 x86_64 x86_64
Alert Count                   4
First Seen                    2018-08-20 16:55:30 CEST
Last Seen                     2018-08-20 17:04:54 CEST
Local ID                      9860e8d4-c074-40d4-82a7-0c0ee560e88d

Raw Audit Messages
type=AVC msg=audit(1534777494.314:3557): avc:  denied  { dac_override } for  pid=71155 comm="snapperd" capability=1  scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tclass=capability permissive=0


Hash: snapperd,snapperd_t,snapperd_t,capability,dac_override

# ausearch -m AVC --start recent
----
time->Mon Aug 20 17:04:54 2018
type=PROCTITLE msg=audit(1534777494.314:3557): proctitle=2F7573722F7362696E2F736E617070657264002D64
type=SYSCALL msg=audit(1534777494.314:3557): arch=c000003e syscall=258 success=no exit=-13 a0=6 a1=7f1de0002f28 a2=1e8 a3=5f7463656a626f3a items=0 ppid=1 pid=71155 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="snapperd" exe="/usr/sbin/snapperd" subj=system_u:system_r:snapperd_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1534777494.314:3557): avc:  denied  { dac_override } for  pid=71155 comm="snapperd" capability=1  scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tclass=capability permissive=0

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-210.el7.noarch
snapper-0.2.8-4.el7.x86_64
3.10.0-933.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.snapper -c bugtest create-config -f "lvm(xfs)" /mnt/test

Actual results:
'Creating config failed (mkdir failed).' and AVC denial

Expected results:
config is created

Additional info:

Comment 3 Dusty Mabe 2019-01-06 16:58:18 UTC
I can also produce/re-produce this on Fedora 29. 


```
[root@localhost ~]# dnf install -y snapper python3-dnf-plugins-extras-snapper
...
[root@localhost ~]# rpm -q snapper
snapper-0.5.6-1.fc29.x86_64
[root@localhost ~]# snapper --config=root create-config /
Creating config failed (creating btrfs subvolume .snapshots failed).
[root@localhost ~]# ausearch -m avc
----
time->Sun Jan  6 16:51:07 2019
type=AVC msg=audit(1546793467.367:234): avc:  denied  { dac_override } for  pid=24405 comm="snapperd" capability=1  scontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:snapperd_t:s0-s0:c0.c1023 tclass=capability permissive=0
```

Comment 4 Dusty Mabe 2019-01-06 17:10:26 UTC
upstream PR: https://github.com/fedora-selinux/selinux-policy-contrib/pull/80

Comment 5 Lukas Vrabec 2019-01-07 16:46:49 UTC
PR merged. 

commit 5b407ea09c2d05b013ea38919ff6676f69c02bca (HEAD -> rawhide, origin/rawhide, origin/HEAD)
Author: Dusty Mabe <dusty>
Date:   Sun Jan 6 12:07:14 2019 -0500

    Add dac_override capability for snapperd_t domain BZ(1619356)


Thanks.

Comment 6 Zdenek Pytela 2019-03-12 08:26:20 UTC
This issue was not selected to be included in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small number of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available.

We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise, we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.


Note You need to log in before you can comment on or make changes to this bug.