All of lore.kernel.org
 help / color / mirror / Atom feed
* MySQL Policy Patch
@ 2004-10-18 15:49 Alex Ackerman
  2004-10-18 16:34 ` Stephen Smalley
  2004-10-19 16:56 ` Jiann-Ming Su
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Ackerman @ 2004-10-18 15:49 UTC (permalink / raw)
  To: selinux


[-- Attachment #1.1: Type: text/plain, Size: 1816 bytes --]

While working on my system, I found the strict policy was inhibiting the
creation of the initial MySQL database files on the system. Because of
this, it was unable to start. I captured the following in my log files:

 

Oct 18 11:20:09 baal kernel: audit(1098112809.602:0): avc:  denied  {
read } for  pid=5150 exe=/usr/libexec/mysqld path=/tmp/sh-thd-1098096392
(deleted) dev=hda3 ino=1827940 scontext=root:system_r:mysqld_t
tcontext=root:object_r:sysadm_tmp_t tclass=file

Oct 18 11:20:09 baal kernel: audit(1098112809.611:0): avc:  denied  {
search } for  pid=5150 exe=/usr/libexec/mysqld name=root dev=hda3
ino=1044481 scontext=root:system_r:mysqld_t
tcontext=root:object_r:staff_home_dir_t tclass=dir

Oct 18 11:20:09 baal kernel: audit(1098112809.615:0): avc:  denied  {
getattr } for  pid=5152 exe=/usr/libexec/mysqld
path=/tmp/sh-thd-1098096392 (deleted) dev=hda3 ino=1827940
scontext=root:system_r:mysqld_t tcontext=root:object_r:sysadm_tmp_t
tclass=file

 

I set the enforcing to 0 and retried the /usr/bin/mysql_install_db
script and everything worked as expected. With enforcing = 1, nothing
was created in /var/lib/mysql/mysql. Running audit2allow on these
messages, it suggested the fixes included in this patch. Basically, add
the following lines to the mysqld.te file:

 

allow mysqld_t staff_home_dir_t:dir { search };

allow mysqld_t sysadm_tmp_t:file { getattr read };

 

For some reason, MySQL is still trying to access staff home directories
in the search for my.cnf. The second rule is for trying to read tmp
files.  After reloading the policy with these changes, running
/usr/bin/mysql_install_db works while in enforcing mode.  

 

Comments?

Alex

 

Sorry if the patch isn't in the right format, I'm still learning how to
do this.


[-- Attachment #1.2: Type: text/html, Size: 5227 bytes --]

[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 475 bytes --]

--- /etc/selinux/strict/src/policy/domains/program/mysqld.te	2004-10-12 11:31:49.955167184 -0400
+++ mysqld.te	2004-10-18 11:26:30.073796544 -0400
@@ -61,6 +61,8 @@
 # for /root/.my.cnf - should not be needed
 allow mysqld_t sysadm_home_dir_t:dir search;
 allow mysqld_t sysadm_home_t:file { read getattr };
+allow mysqld_t staff_home_dir_t:dir { search };
+allow mysqld_t sysadm_tmp_t:file { getattr read };
 
 ifdef(`logrotate.te', `
 r_dir_file(logrotate_t, mysqld_etc_t)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-23  6:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-18 15:49 MySQL Policy Patch Alex Ackerman
2004-10-18 16:34 ` Stephen Smalley
2004-10-28 13:01   ` Russell Coker
2004-10-19 16:56 ` Jiann-Ming Su
2004-10-19 17:02   ` Stephen Smalley
2004-11-05 19:53     ` Jiann-Ming Su
2004-11-23  5:09       ` Russell Coker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.