Bug 192904 - Default policy for MySQL disallows setting open_files_limit
Summary: Default policy for MySQL disallows setting open_files_limit
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: selinux-policy-targeted
Version: 4.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Daniel Walsh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-23 22:42 UTC by Grant Robinson
Modified: 2008-01-30 19:05 UTC (History)
1 user (show)

Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-30 19:05:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Grant Robinson 2006-05-23 22:42:58 UTC
Description of problem:
The default policy for mysqld does not allow you to set the open_files_limit.  Attempts to do so result
in a selinux message being logged


Version-Release number of selected component (if applicable):selinux-policy-targeted-1.17.30-2.126


How reproducible: Completely reproducible


Steps to Reproduce:
1. add the following line to your /etc/my.cnf file:

set-variable = open_files_limit=8192

2. restart mysql

3.  Look at /var/log/messages.  You will see an selinux log message that an action was denied

4.  Look at the /var/log/mysqld.log - you will see that MySQL was unable to change the parameter

  
Actual results:


Expected results:


Additional info:
This can be fixed by updating the policy file in /etc/selinux/targeted/src/policy/domains/program/
mysqld.te, which I have done and it is now working.  Just wanted to get this bug logged so that it can 
be fixed in the default install.

Comment 1 Daniel Walsh 2006-05-25 18:05:07 UTC
What AVC messages are you seeing?

Comment 2 Grant Robinson 2006-05-25 18:16:48 UTC
audit(1148420382.015:56): avc:  denied  { sys_resource } for  pid=23201 co
mm="mysqld" capability=24 scontext=root:system_r:mysqld_t tcontext=root:system_r:mysqld_t 
tclass=capab
ility

Comment 3 Grant Robinson 2006-05-25 18:19:30 UTC
BTW, these are the two lines that I changed in /etc/selinux/targeted/src/policy/domains/program/
mysqld.te:

allow mysqld_t self:capability { dac_override setgid setuid net_bind_service sys_resource };
allow mysqld_t self:process { setsched getsched setrlimit rlimitinh };

The combination of those two works.  Just adding the 'setrlimit' to self:process did not work, but I 
didn't try adding just 'sys_resource' to self:capability.

Comment 4 Daniel Walsh 2006-06-15 22:29:32 UTC
Fixed in selinux-policy-targeted-1.17.30-2.138


Comment 5 Daniel Walsh 2008-01-30 19:05:34 UTC
Bulk closing a old selinux policy bugs that were in the modified state.  If the
bug is still not fixed.  Please reopen.


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