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 722381 - selinux policy does not allow squeezeboxserver to start
Summary: selinux policy does not allow squeezeboxserver to start
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-15 06:48 UTC by Marko Karg
Modified: 2012-10-16 11:35 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.7.19-104.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:09:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1511 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2011-12-06 00:39:17 UTC

Description Marko Karg 2011-07-15 06:48:43 UTC
Description of problem:

selinux policy does not allow the squeezeboxserver application to open the my.cnf configuration file for mysql

Version-Release number of selected component (if applicable):

selinux-policy-targeted-3.7.19-93.el6_1.2.noarch

How reproducible:

always
Steps to Reproduce:

1. Have a RHEL 6.1 running in enforced mode
2. Install the squeezeboxserver software from Logitech and try to start it.
  
Actual results:

selinux denial:

type=AVC msg=audit(1310711263.912:62001): avc:  denied  { getattr } for  pid=637 comm="mysqld" path="/var/lib/squeezeboxserver/cache/my.cnf" dev=dm-0 ino=395089 scontext=unconfined_u:system_r:mysqld_t:s0 t
context=unconfined_u:object_r:var_lib_t:s0 tclass=file
type=SYSCALL msg=audit(1310711263.912:62001): arch=c000003e syscall=4 success=no exit=-13 a0=7fffd9390090 a1=7fffd938cff0 a2=7fffd938cff0 a3=fffffffffffffffd items=0 ppid=635 pid=637 auid=0 uid=498 gid=496
 euid=498 suid=498 fsuid=498 egid=496 sgid=496 fsgid=496 tty=(none) ses=136 comm="mysqld" exe="/usr/libexec/mysqld" subj=unconfined_u:system_r:mysqld_t:s0 key=(null)

Expected results:

Either the policy should allow the opening of my.cnf or at least allow to chcon of the necessary files, but that's also forbidden :(
Additional info:

Comment 2 Miroslav Grepl 2011-07-15 10:47:17 UTC
chcon -R -t mysqld_db_t /var/lib/squeezeboxserver

should fix.

What does

rpm -qf /var/lib/squeezeboxserver

Comment 3 Marko Karg 2011-07-15 10:56:16 UTC
[root@colossus ~]# chcon -R -t mysql_db_t /var/lib/squeezeboxserver/
[root@colossus ~]# rpm -qf /var/lib/squeezeboxserver/
squeezeboxserver-7.5.5-1.noarch
[root@colossus ~]# service squeezeboxserver stop
Stopping Squeezebox Server:                                [  OK  ]
[root@colossus ~]# setenforce 1
[root@colossus ~]# service squeezeboxserver start
Starting Squeezebox Server: [11-07-15 12:51:41.0877] main::init (326) Starting Squeezebox Server (v7.5.5, r32671, Mon Jul 11 12:56:10 MDT 2011) perl 5.010001
                                                           [  OK  ]
[root@colossus ~]# Could not open required defaults file: /var/lib/squeezeboxserver/cache/my.cnf
Fatal error in defaults handling. Program aborted
110715 12:51:41 [Warning] Can't create test file /var/lib/mysql/colossus.lower-test
110715 12:51:41 [Warning] Can't create test file /var/lib/mysql/colossus.lower-test
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
110715 12:51:41 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110715 12:51:41  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.

type=AVC msg=audit(1310727101.513:41513): avc:  denied  { search } for  pid=11889 comm="mysqld" name="squeezeboxserver" dev=dm-0 ino=394590 scontext=unconfined_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir
type=SYSCALL msg=audit(1310727101.513:41513): arch=c000003e syscall=4 success=no exit=-13 a0=7fff4137ee90 a1=7fff4137bdf0 a2=7fff4137bdf0 a3=fffffffffffffffd items=0 ppid=11887 pid=11889 auid=0 uid=498 gid=496 euid=498 suid=498 fsuid=498 egid=496 sgid=496 fsgid=496 tty=(none) ses=18 comm="mysqld" exe="/usr/libexec/mysqld" subj=unconfined_u:system_r:mysqld_t:s0 key=(null)
type=AVC msg=audit(1310727131.949:41514): avc:  denied  { search } for  pid=11940 comm="mysqld" name="squeezeboxserver" dev=dm-0 ino=394590 scontext=unconfined_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir
type=SYSCALL msg=audit(1310727131.949:41514): arch=c000003e syscall=4 success=no exit=-13 a0=7fff72b25d30 a1=7fff72b22c90 a2=7fff72b22c90 a3=fffffffffffffffd items=0 ppid=11887 pid=11940 auid=0 uid=498 gid=496 euid=498 suid=498 fsuid=498 egid=496 sgid=496 fsgid=496 tty=(none) ses=18 comm="mysqld" exe="/usr/libexec/mysqld" subj=unconfined_u:system_r:mysqld_t:s0 key=(null)

Comment 4 Miroslav Grepl 2011-07-15 11:28:47 UTC
Typo, I meant

chcon -R -t mysqld_db_t /var/lib/squeezeboxserver/

Comment 5 Marko Karg 2011-07-15 11:39:19 UTC
ah, could have figured out myself :)

That did the trick, but what about the policy, what will happen when the system gets relabeled?

Comment 6 Marko Karg 2011-07-15 11:39:35 UTC
Not to forget: Thanks!

Comment 7 Miroslav Grepl 2011-07-15 14:06:40 UTC
Because of 

rpm -qf /var/lib/squeezeboxserver/
squeezeboxserver-7.5.5-1.noarch


we can add this label to the default policy.

Comment 8 Miroslav Grepl 2011-07-20 10:10:43 UTC
Fixed in selinux-policy-3.7.19-104.el6

Comment 11 errata-xmlrpc 2011-12-06 10:09:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1511.html


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