Bug 950753

Summary: SELinux is preventing /usr/bin/rsync from 'write' accesses on the file swift_server.lock.
Product: [Fedora] Fedora Reporter: Jeff Peeler <jpeeler>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: derekh, dominick.grift, dwalsh, Jan.van.Eldik, lhh, mgrepl, mmagr, p, sandro
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:bf37326d833eb3a569e955fb9307f464bdff33d3a6f79d662df395e4c0cb5af1
Fixed In Version: selinux-policy-3.11.1-108.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-05 06:07:46 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 Jeff Peeler 2013-04-10 19:32:07 UTC
Description of problem:
packstack --allinone install from side repos.
SELinux is preventing /usr/bin/rsync from 'write' accesses on the file swift_server.lock.

*****  Plugin catchall_boolean (89.3 confidence) suggests  *******************

If you want to allow rsync server to manage all files/directories on the system.
Then you must tell SELinux about this by enabling the 'rsync_full_access' boolean.
You can read 'rsync_selinux' man page for more details.
Do
setsebool -P rsync_full_access 1

*****  Plugin catchall (11.6 confidence) suggests  ***************************

If you believe that rsync should be allowed write access on the swift_server.lock file 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 rsync /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:rsync_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_lock_t:s0
Target Objects                swift_server.lock [ file ]
Source                        rsync
Source Path                   /usr/bin/rsync
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           rsync-3.0.9-5.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-86.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.8.5-201.fc18.x86_64 #1 SMP Thu
                              Mar 28 21:01:19 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-04-10 15:22:19 EDT
Last Seen                     2013-04-10 15:22:22 EDT
Local ID                      4981e1fa-8d1b-4aa0-b17c-0243515554f3

Raw Audit Messages
type=AVC msg=audit(1365621742.205:9316): avc:  denied  { write } for  pid=22762 comm="rsync" name="swift_server.lock" dev="tmpfs" ino=159541 scontext=system_u:system_r:rsync_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_lock_t:s0 tclass=file


type=SYSCALL msg=audit(1365621742.205:9316): arch=x86_64 syscall=open success=yes exit=EINTR a0=6a3e40 a1=42 a2=180 a3=8 items=0 ppid=21528 pid=22762 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=rsync exe=/usr/bin/rsync subj=system_u:system_r:rsync_t:s0-s0:c0.c1023 key=(null)

Hash: rsync,rsync_t,var_lock_t,file,write

audit2allow

#============= rsync_t ==============
#!!!! This avc can be allowed using the boolean 'rsync_full_access'

allow rsync_t var_lock_t:file write;

audit2allow -R
require {
	type rsync_t;
}

#============= rsync_t ==============
files_manage_generic_locks(rsync_t)


Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.5-201.fc18.x86_64
type:           libreport

Comment 1 Jeff Peeler 2013-04-10 19:38:43 UTC
I can't imagine this going into default selinux policy, so I changed the component to what seems more appropriate. Please reassign if necessary.

Comment 2 Jeff Peeler 2013-04-10 19:45:24 UTC
Apparently for Fedora it does indeed, switching back.

Comment 3 Daniel Walsh 2013-04-11 19:15:18 UTC
Currently we have /var/run/rsyncd\.lock labeling.  I guess we can add the labeling for swift.  Any reason to change the name.

Comment 4 Sandro Mathys 2013-10-23 14:36:24 UTC
This is still an issue in F20 (Beta TC5 with updates-testing).

Comment 5 Daniel Walsh 2013-10-24 17:50:36 UTC
Sandro what tool is using the name /var/run/swift_server\.lock?

Comment 6 Daniel Walsh 2013-10-24 18:02:06 UTC
91f47228cf6596f5b4158a3240db257d584310c7 and 
5ff2eae7745b6fe4dcacb0e722415613d880f77c fix this in git.

Comment 7 Lukas Vrabec 2013-10-29 12:52:40 UTC
back ported.

Comment 8 Fedora Update System 2013-12-19 23:59:35 UTC
selinux-policy-3.11.1-108.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-108.fc18

Comment 9 Fedora Update System 2013-12-21 02:17:59 UTC
Package selinux-policy-3.11.1-108.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-108.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-23716/selinux-policy-3.11.1-108.fc18
then log in and leave karma (feedback).

Comment 10 Fedora End Of Life 2013-12-21 15:45:50 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. 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 WONTFIX if it remains open with a Fedora 
'version' of '18'.

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 prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 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 to Fedora 18's end of life.

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.

Comment 11 Fedora Update System 2014-01-05 06:07:46 UTC
selinux-policy-3.11.1-108.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.