Bug 952525

Summary: SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the sock_file /var/lib/mysql/mysql.sock.
Product: [Fedora] Fedora Reporter: Arindam Choudhury <arindam>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:2fe9e992a7a7b34955920a018dfe963549d2c59e7d010e9b38bbff9fc31c50aa
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-20 01:03:13 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 Arindam Choudhury 2013-04-16 06:39:53 UTC
Description of problem:
SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the sock_file /var/lib/mysql/mysql.sock.

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

If you believe that python2.7 should be allowed write access on the mysql.sock sock_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 nova-consoleaut /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:nova_console_t:s0
Target Context                system_u:object_r:mysqld_var_run_t:s0
Target Objects                /var/lib/mysql/mysql.sock [ sock_file ]
Source                        nova-consoleaut
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.3-13.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-90.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.8.7-201.fc18.x86_64 #1 SMP Fri
                              Apr 12 19:46:19 UTC 2013 x86_64 x86_64
Alert Count                   16
First Seen                    2013-04-15 18:14:52 CEST
Last Seen                     2013-04-16 08:38:44 CEST
Local ID                      1eefaea9-eaad-4d97-a5ef-b5b351c916cf

Raw Audit Messages
type=AVC msg=audit(1366094324.967:461): avc:  denied  { write } for  pid=1114 comm="nova-consoleaut" name="mysql.sock" dev="sda5" ino=525257 scontext=system_u:system_r:nova_console_t:s0 tcontext=system_u:object_r:mysqld_var_run_t:s0 tclass=sock_file


type=AVC msg=audit(1366094324.967:461): avc:  denied  { connectto } for  pid=1114 comm="nova-consoleaut" path="/var/lib/mysql/mysql.sock" scontext=system_u:system_r:nova_console_t:s0 tcontext=system_u:system_r:mysqld_t:s0 tclass=unix_stream_socket


type=SYSCALL msg=audit(1366094324.967:461): arch=x86_64 syscall=connect success=yes exit=0 a0=5 a1=7fffa2ee72f0 a2=6e a3=4000 items=0 ppid=1 pid=1114 auid=4294967295 uid=162 gid=162 euid=162 suid=162 fsuid=162 egid=162 sgid=162 fsgid=162 ses=4294967295 tty=(none) comm=nova-consoleaut exe=/usr/bin/python2.7 subj=system_u:system_r:nova_console_t:s0 key=(null)

Hash: nova-consoleaut,nova_console_t,mysqld_var_run_t,sock_file,write

audit2allow

#============= nova_console_t ==============
allow nova_console_t mysqld_t:unix_stream_socket connectto;
allow nova_console_t mysqld_var_run_t:sock_file write;

audit2allow -R
require {
	type nova_console_t;
}

#============= nova_console_t ==============
mysql_stream_connect(nova_console_t)


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

Comment 1 Miroslav Grepl 2013-04-16 08:32:02 UTC
Fixed in selinux-policy-3.11.1-91.fc18.noarch

Comment 2 Fedora Update System 2013-04-18 12:52:06 UTC
selinux-policy-3.11.1-91.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-91.fc18

Comment 3 Fedora Update System 2013-04-19 04:49:34 UTC
Package selinux-policy-3.11.1-91.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-91.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-6018/selinux-policy-3.11.1-91.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-04-20 01:03:14 UTC
selinux-policy-3.11.1-91.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.