Bug 15852 - SELinux is preventing /usr/libexec/mysqld "unlink" access on /var/lib/squeezeboxserver/cache/squeezebox-mysql.sock
: SELinux is preventing /usr/libexec/mysqld "unlink" access on /var/lib/squeeze...
Status: RESOLVED WONTFIX
Product: Logitech Media Server
Classification: Unclassified
Component: RPM
: 7.4.2
: PC Fedora
: -- normal with 2 votes (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-08 05:14 UTC by rené
Modified: 2016-11-27 21:11 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rené 2010-03-08 05:14:56 UTC
Summary:

SELinux is preventing /usr/libexec/mysqld "unlink" access on
/var/lib/squeezeboxserver/cache/squeezebox-mysql.sock.

Detailed Description:

SELinux denied access requested by mysqld. It is not expected that this access
is required by mysqld and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                unconfined_u:system_r:mysqld_t:s0
Target Context                system_u:object_r:mysqld_db_t:s0
Target Objects                /var/lib/squeezeboxserver/cache/squeezebox-
                              mysql.sock [ sock_file ]
Source                        mysqld
Source Path                   /usr/libexec/mysqld
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           mysql-server-5.1.42-2.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-69.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed) 2.6.31.12-174.2.3.fc12.i686.PAE
#1
                              SMP Mon Jan 18 20:06:44 UTC 2010 i686 i686
Alert Count                   2
First Seen                    Sun 24 Jan 2010 02:55:38 AM IST
Last Seen                     Sun 24 Jan 2010 02:55:47 AM IST
Local ID                      ada77b93-b8f2-4b78-a1e0-4384321efbe3
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1264294547.183:40072): avc:  denied  { unlink
} for  pid=3803 comm="mysqld" name="squeezebox-mysql.sock" dev=dm-0 ino=1179
scontext=unconfined_u:system_r:mysqld_t:s0
Comment 1 rené 2010-03-08 05:17:04 UTC
The problem is squeezeboxserver sets up the following context:

sh-4.0# rpm -q --scripts squeezeboxserver | grep "semanage fcontext -a"
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage fcontext -a -t mysqld_db_t
"${CACHEDIR}(/.*)?"
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage fcontext -a -t mysqld_var_run_t
"${CACHEDIR}/squeezeboxserver-mysql.sock"


"squeezeboxserver-mysql.sock" should be changed to "squeezebox-mysql.sock"


The proper label should be set using:

semanage fcontext -a -t mysqld_var_run_t
"/var/lib/squeezeboxserver/cache/squeezebox-mysql.sock" 

see: https://bugzilla.redhat.com/show_bug.cgi?id=558163
Comment 2 Paul Chandler 2010-03-19 09:57:49 UTC
I didn't get this message until AFTER I upgraded from 7.4.2 to 7.5x (7.5.0-0.1.30391) I don't think I see the error if I install 7.5x on a clean system (with no upgrade)
Comment 3 Eric Sandeen 2011-03-01 15:15:04 UTC
(In reply to comment #2)
> I didn't get this message until AFTER I upgraded from 7.4.2 to 7.5x
> (7.5.0-0.1.30391) I don't think I see the error if I install 7.5x on a clean
> system (with no upgrade)

This is still an issue for me, after a fresh 7.5.1 install on a RHEL6 box.
Comment 4 Eric Sandeen 2011-03-01 19:33:20 UTC
Here's the full list I needed to get it up and running happy on RHEL6:

port -a -t mysqld_port_t -p tcp 9092

fcontext -a -f 'all files' -t mysqld_var_run_t '/var/lib/squeezeboxserver/cache'
fcontext -a -f 'all files' -t mysqld_db_t '/var/lib/squeezeboxserver/cache(/.*)?'
fcontext -a -f 'all files' -t mysqld_etc_t '/var/lib/squeezeboxserver/cache/my.cnf'
fcontext -a -f 'all files' -t mysqld_log_t '/var/lib/squeezeboxserver/cache/mysql-error-log.txt'
fcontext -a -f 'all files' -t mysqld_var_run_t '/var/lib/squeezeboxserver/cache/squeezebox-mysql.pid'
fcontext -a -f 'all files' -t mysqld_var_run_t '/var/lib/squeezeboxserver/cache/squeezebox-mysql.sock'