Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 8th February 2005, 02:35 PM
lothario Offline
Registered User
 
Join Date: Jun 2004
Posts: 130
/var/log/messages - kernel: audit(1107868785.573:0): avc: denied { getattr }

Just did a fresh install of Fedora Core 3 including Apache, PHP and MySQL.
The system is current using up2date.

Noticed this message in /var/log/messages
Quote:
Feb 8 05:19:45 localhost kernel: audit(1107868785.573:0): avc: denied { getattr } for pid=4126 exe=/usr/bin/mysql path=/etc/my.cnf dev=hda1 ino=136043 scontext=user_u:system_r:httpd_sys_script_t tcontext=system_u : object_r:mysqld_etc_t tclass=file
The above entry shows up in /var/log/messages
everytime this shell script is executed
Code:
mysql -h hostNAME  -u UserNAME    databaseNAME  <  input.txt   >    output.txt
What does the log message mean?
What needs to be fixed?
Reply With Quote
  #2  
Old 8th February 2005, 03:14 PM
jim's Avatar
jim Offline
Retired Community Manager & Avid Drinker Of Suds
 
Join Date: Feb 2005
Location: Rochester NY
Age: 38
Posts: 4,176
Do you have Selinux turned on?

Read the release notes at http://fedora.redhat.com/docs/

I think there is something in there about selinux. If in doubt, Turn off Selinux and see if you still get the error message.

Remember the "Reputation" button is there for you to tell me if I helped you....
__________________
Registered Linux User: #376813
Western NY
My linux site
Smolt Profile

please remember to say if you problem was solved

Did you get your id10t award today?
Reply With Quote
  #3  
Old 8th February 2005, 04:07 PM
lothario Offline
Registered User
 
Join Date: Jun 2004
Posts: 130
Yes, I have Selinux turned on.
I have it working for one web site under /var/www/html/redd with the proper chcon settings.

I read the material at http://fedora.redhat.com/docs/

But it is not clear to me how I deal with the above var log message.
So far Selinux is working for me with this one exception.
I would like to avoid turning off Selinux given the security benefits.

Any other thoughts?
Reply With Quote
  #4  
Old 8th February 2005, 04:33 PM
macemoneta's Avatar
macemoneta Offline
Registered User
 
Join Date: May 2004
Location: NJ
Posts: 913
Follow the instructions in this post
Reply With Quote
  #5  
Old 8th February 2005, 04:52 PM
lothario Offline
Registered User
 
Join Date: Jun 2004
Posts: 130
I read the post.

I do not have the folders
/etc/selinux/targeted/src/policy/domains/misc/
/etc/selinux/targeted/src/policy/domains/
/etc/selinux/targeted/src/policy/
/etc/selinux/targeted/src/

All I have is
Quote:
ls -al /etc/selinux/targeted/
total 40
drwxr-xr-x 4 root root 4096 Feb 3 05:44 .
drwxr-xr-x 3 root root 4096 Jan 28 10:44 ..
-rwx------ 1 root root 120 Jan 28 10:44 booleans
drwxr-xr-x 4 root root 4096 Feb 3 05:44 contexts
drwxr-xr-x 2 root root 4096 Feb 3 05:44 policy
Reply With Quote
  #6  
Old 8th February 2005, 05:05 PM
macemoneta's Avatar
macemoneta Offline
Registered User
 
Join Date: May 2004
Location: NJ
Posts: 913
Quote:
Originally Posted by lothario
I read the post.

I do not have the folders
/etc/selinux/targeted/src/policy/domains/misc/
/etc/selinux/targeted/src/policy/domains/
/etc/selinux/targeted/src/policy/
/etc/selinux/targeted/src/

Then you didn't install the sources in the second step.
Reply With Quote
  #7  
Old 8th February 2005, 05:12 PM
lothario Offline
Registered User
 
Join Date: Jun 2004
Posts: 130
You are correct.
I read your post. Thats all.
Before making the changes (as root) I wanted to get this clarification.

Before following your steps, do I need to stop Apache or MySQL.
Or reboot after the steps?
Reply With Quote
  #8  
Old 8th February 2005, 06:28 PM
macemoneta's Avatar
macemoneta Offline
Registered User
 
Join Date: May 2004
Location: NJ
Posts: 913
No; changes to SELinux policy are dynamic. As soon as you issue the "make" command, the new policy will be in effect. Likewise, if you are unhappy with any changes you have made, simply remove the local.te file, and reissue the make command to re-establish the default targeted policy.
Reply With Quote
  #9  
Old 8th February 2005, 07:08 PM
lothario Offline
Registered User
 
Join Date: Jun 2004
Posts: 130
To repeat the process, do I have to do
yum -y install selinux-policy-targeted-sources
again?
Reply With Quote
  #10  
Old 8th February 2005, 07:38 PM
lothario Offline
Registered User
 
Join Date: Jun 2004
Posts: 130
Ok, I did all that.

But I still get this message in /var/log/messages

Quote:
Feb 8 11:32:46 localhost kernel:
audit(1107891166.219:0):
avc: denied { read } for
pid=3896
exe=/usr/bin/mysql
name=my.cnf
dev=hda1
ino=136043
scontext=user_u:system_r:httpd_sys_script_t
tcontext=system_u:object_r:mysqld_etc_t
tclass=file
Under the same circumstances.
Reply With Quote
  #11  
Old 8th February 2005, 07:43 PM
macemoneta's Avatar
macemoneta Offline
Registered User
 
Join Date: May 2004
Location: NJ
Posts: 913
To repeat the process, simply update the local.te and re-issue the make.

The selinux-policy-targeted-sources package contains the base set of policies that make up the Fedora "targeted" policy definition. By creating/modifying local.te, you are augmenting that policy.

The make command converts the source form of that policy into a binary which is loaded and used by the kernel. When you issue the make, you will see messages in /var/log/messages indicating that the new policy has been loaded. Since you have additional policy statements in local.te, the created binary will include your policy changes.

If you remove local.te, or modify it again, then re-issuing the make repeats the process of combining the base policies with your local changes (if any).
Reply With Quote
  #12  
Old 8th February 2005, 07:52 PM
macemoneta's Avatar
macemoneta Offline
Registered User
 
Join Date: May 2004
Location: NJ
Posts: 913
Quote:
Originally Posted by lothario
Ok, I did all that.

But I still get this message in /var/log/messages


Under the same circumstances.

If you look closely, you'll see that the first message was for a "{ getattr }" operation, and the second was for a "{ read }" operation. You will need to iteratively repeat the process until there are no further avc denied messages.

What's happening is that SELinux is preventing the software from performing an operation, so the software doesn't proceed. When you allow the first operation, the software proceeds further, until it encounters another prohibited operation.

You can find all the operations needed to complete the process by issuing the command:

setenforce Permissive

In this mode, SELinux still logs all the avc denied messages, but doesn't prevent the operations from completing. However, the protections afforded by SELinux in this mode are disabled.

Once you have all the avc denied messages handled by local.te policy, you can:

setenforce Enforcing

to return the system to normal operation. SELinux will prevent any operations prohibited by its policy in this mode.
Reply With Quote
  #13  
Old 8th February 2005, 08:49 PM
lothario Offline
Registered User
 
Join Date: Jun 2004
Posts: 130
Great. That helped. Thank you.
I repeated the process until there were no avc denied messages.
It helps to have a small /var/log/messages file so you can follow it slowly.
To get a small file I did reboot. I know reboot was not necessary.
But it helped me identify, isolate and remove the denied messages one-by-one.
Reply With Quote
  #14  
Old 13th February 2005, 10:15 PM
snick Offline
Registered User
 
Join Date: Feb 2005
Posts: 1
one thing i figured out the hard way is do the ls -Z on the dir also. I had created the public_html while root. Permissions didn't match so apache couldn't read the contents.
Reply With Quote
Reply

Tags
audit, avc, denied, getattr, kernel, or var or log or messages

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel audit - /var/log/messages timinator Security and Privacy 0 13th November 2007 05:39 PM
Selinux - audit messages yeauch Using Fedora 3 14th July 2005 02:59 PM
kernel: audit( ... ): avc: denied { read } lothario Using Fedora 1 2nd June 2005 10:47 AM


Current GMT-time: 23:40 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat