Bug 673008

Summary: SELinux is preventing /usr/bin/mpd from 'read' accesses on the directory /home/mpd/music.
Product: [Fedora] Fedora Reporter: Ari Feinberg <ari.j.feinberg>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:334988c4363f5b9b5ccb80321d4b6b6cc485211793b26964e88ee8c280a33ece
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-27 11:23:02 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 Ari Feinberg 2011-01-27 00:35:40 UTC
SELinux is preventing /usr/bin/mpd from 'read' accesses on the directory /home/mpd/music.

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

If you believe that mpd should be allowed read access on the music directory 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 mpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:mpd_t:s0
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/mpd/music [ dir ]
Source                        mpd
Source Path                   /usr/bin/mpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           mpd-0.15.12-1.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-19.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.10-74.fc14.x86_64
                              #1 SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   3
First Seen                    Sat 15 Jan 2011 05:24:09 PM EST
Last Seen                     Sun 16 Jan 2011 08:28:33 PM EST
Local ID                      35d06354-cfed-4255-9499-88ea975835d5

Raw Audit Messages
type=AVC msg=audit(1295227713.73:28834): avc:  denied  { read } for  pid=13354 comm="mpd" name="music" dev=dm-2 ino=2883588 scontext=system_u:system_r:mpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir

mpd,mpd_t,user_home_t,dir,read
type=AVC msg=audit(1295227713.73:28834): avc:  denied  { open } for  pid=13354 comm="mpd" name="music" dev=dm-2 ino=2883588 scontext=system_u:system_r:mpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir

mpd,mpd_t,user_home_t,dir,read
type=SYSCALL msg=audit(1295227713.73:28834): arch=x86_64 syscall=open success=yes exit=ESRCH a0=7fc94000ffa0 a1=90800 a2=382573dd46 a3=1 items=0 ppid=1 pid=13354 auid=4294967295 uid=487 gid=470 euid=487 suid=487 fsuid=487 egid=470 sgid=470 fsgid=470 tty=(none) ses=4294967295 comm=mpd exe=/usr/bin/mpd subj=system_u:system_r:mpd_t:s0 key=(null)
mpd,mpd_t,user_home_t,dir,read

#============= mpd_t ==============
allow mpd_t user_home_t:dir { read open };

Comment 1 Miroslav Grepl 2011-01-27 11:23:02 UTC
We define in the policy

HOME_DIR/Music(/.*)?    gen_context(system_u:object_r:audio_home_t,s0)
HOME_DIR/Audio(/.*)?    gen_context(system_u:object_r:audio_home_t,s0)

If you mv it to ~/Audio or ~/Music and run restorecon on it, the MPD daemon
will be able to read it.

Or you need to setup the proper label for this directory.

# semanage fcontext -a -e /home/mpd/Music /home/mgrepl/music
# restorecon -Rv /home/mpd/music/