Bug 192904 - Default policy for MySQL disallows setting open_files_limit
Default policy for MySQL disallows setting open_files_limit
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: selinux-policy-targeted (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Daniel Walsh
Depends On:
  Show dependency treegraph
Reported: 2006-05-23 18:42 EDT by Grant Robinson
Modified: 2008-01-30 14:05 EST (History)
1 user (show)

See Also:
Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-30 14:05:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Grant Robinson 2006-05-23 18:42:58 EDT
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 14:05:07 EDT
What AVC messages are you seeing?
Comment 2 Grant Robinson 2006-05-25 14:16:48 EDT
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 
Comment 3 Grant Robinson 2006-05-25 14:19:30 EDT
BTW, these are the two lines that I changed in /etc/selinux/targeted/src/policy/domains/program/

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 18:29:32 EDT
Fixed in selinux-policy-targeted-1.17.30-2.138
Comment 5 Daniel Walsh 2008-01-30 14:05:34 EST
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.