Bug 1389485

Summary: SELinux is preventing tgtd from using the 'wake_alarm' capabilities.
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: dick, dominick.grift, dwalsh, lnie, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:c33d30c615e3ed583ac5af563d3186193366db0e69822a485dbf1edaf33c20cf;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-3.13.1-225.1.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-08 18:22:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Adam Williamson 2016-10-27 17:27:17 UTC
Description of problem:
This AVC appears on starting `tgtd.service` after defining a target in `/etc/tgt/conf.d/` - basically, setting the system up as an iSCSI 'server' and starting it up.
SELinux is preventing tgtd from using the 'wake_alarm' capabilities.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that tgtd should have the wake_alarm 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 'tgtd' --raw | audit2allow -M my-tgtd
# semodule -X 300 -i my-tgtd.pp

Additional Information:
Source Context                system_u:system_r:tgtd_t:s0
Target Context                system_u:system_r:tgtd_t:s0
Target Objects                Unknown [ capability2 ]
Source                        tgtd
Source Path                   tgtd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-216.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.8.0-0.rc7.git0.1.fc25.x86_64 #1
                              SMP Mon Sep 19 15:24:06 UTC 2016 x86_64 x86_64
Alert Count                   2
First Seen                    2016-10-27 10:25:41 PDT
Last Seen                     2016-10-27 10:25:41 PDT
Local ID                      b437b015-a032-4898-bdd6-7c7714a3c6b9

Raw Audit Messages
type=AVC msg=audit(1477589141.190:210): avc:  denied  { wake_alarm } for  pid=1988 comm="tgtd" capability=35  scontext=system_u:system_r:tgtd_t:s0 tcontext=system_u:system_r:tgtd_t:s0 tclass=capability2 permissive=0


Hash: tgtd,tgtd_t,tgtd_t,capability2,wake_alarm

Version-Release number of selected component:
selinux-policy-3.13.1-216.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.0-0.rc7.git0.1.fc25.x86_64
type:           libreport

Comment 1 lnie 2016-11-28 07:26:59 UTC
Description of problem:

Just as #bz1399048:
chcon -t tgtd_var_lib_t /srv/iscsi/disk1.img and "systemctl start tgtd"
Get these two AVCs after "systemctl start tgtd"

Version-Release number of selected component:
selinux-policy-3.13.1-224.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.6-300.fc25.x86_64
type:           libreport

Comment 2 Fedora Update System 2016-12-05 17:01:28 UTC
selinux-policy-3.13.1-225.1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-e3864b8972

Comment 3 Fedora Update System 2016-12-07 02:25:09 UTC
selinux-policy-3.13.1-225.1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e3864b8972

Comment 4 Fedora Update System 2016-12-08 18:22:11 UTC
selinux-policy-3.13.1-225.1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.