Bug 814001 - SELinux is preventing /usr/libexec/mysqld from 'read' accesses on the file /home/mysql/mysql/wikidb/db.opt.
Summary: SELinux is preventing /usr/libexec/mysqld from 'read' accesses on the file /h...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 16
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:2755cb4bc6dd7b51ff6e211c421...
: 814030 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-19 01:03 UTC by Adrin Jalali
Modified: 2012-04-20 14:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-20 14:52:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Adrin Jalali 2012-04-19 01:03:27 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.3.1-5.fc16.x86_64
reason:         SELinux is preventing /usr/libexec/mysqld from 'read' accesses on the file /home/mysql/mysql/wikidb/db.opt.
time:           Wed 18 Apr 2012 06:03:20 PM PDT

description:
:SELinux is preventing /usr/libexec/mysqld from 'read' accesses on the file /home/mysql/mysql/wikidb/db.opt.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that mysqld should be allowed read access on the db.opt 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 mysqld /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:mysqld_t:s0
:Target Context                system_u:object_r:user_home_t:s0
:Target Objects                /home/mysql/mysql/wikidb/db.opt [ file ]
:Source                        mysqld
:Source Path                   /usr/libexec/mysqld
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           mysql-server-5.5.22-1.fc16.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-80.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.1-5.fc16.x86_64 #1 SMP Tue
:                              Apr 10 19:56:52 UTC 2012 x86_64 x86_64
:Alert Count                   4
:First Seen                    Fri 06 Apr 2012 07:01:02 PM PDT
:Last Seen                     Wed 18 Apr 2012 06:02:20 PM PDT
:Local ID                      1a611280-4ad5-4728-8414-355934a3e586
:
:Raw Audit Messages
:type=AVC msg=audit(1334797340.938:159): avc:  denied  { read } for  pid=10015 comm="mysqld" name="db.opt" dev="sdb4" ino=34078959 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file
:
:
:type=AVC msg=audit(1334797340.938:159): avc:  denied  { open } for  pid=10015 comm="mysqld" name="db.opt" dev="sdb4" ino=34078959 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1334797340.938:159): arch=x86_64 syscall=open success=yes exit=EPIPE a0=7fb80c56fd80 a1=0 a2=1b0 a3=f6ce6c items=0 ppid=1 pid=10015 auid=4294967295 uid=27 gid=27 euid=27 suid=27 fsuid=27 egid=27 sgid=27 fsgid=27 tty=(none) ses=4294967295 comm=mysqld exe=/usr/libexec/mysqld subj=system_u:system_r:mysqld_t:s0 key=(null)
:
:Hash: mysqld,mysqld_t,user_home_t,file,read
:
:audit2allow
:
:#============= mysqld_t ==============
:allow mysqld_t user_home_t:file { read open };
:
:audit2allow -R
:
:#============= mysqld_t ==============
:allow mysqld_t user_home_t:file { read open };
:

Comment 1 Daniel Walsh 2012-04-20 14:52:36 UTC
If you want to put a mysql database in your homedirs you will have to either setup labeling for ot or allow the access by building a custom policy.

# semanage fcontext -a -t mysql_db_t '/home/mysql/mysq(/.*)?'
# restorecon -R -v /home/mysql/mysq

Or 

# grep mysqld /var/log/audit/audit.log | audit2allow -M mymysql
# semodule -i mymysql.pp

Comment 2 Daniel Walsh 2012-04-20 14:53:58 UTC
*** Bug 814030 has been marked as a duplicate of this bug. ***


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