Bug 245109

Summary: Kadmind of krb5 fails to work with SELinux.
Product: [Fedora] Fedora Reporter: Bharath Bhushan Lohray <lord.loh>
Component: krb5Assignee: Nalin Dahyabhai <nalin>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7CC: dwalsh, gvarisco, triage
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-16 21:40:10 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
audit.log file none

Description Bharath Bhushan Lohray 2007-06-21 02:10:13 EDT
Description of problem: kadmin wants to read the words file but is deined by

Version-Release number of selected component (if applicable):

How reproducible: Configure Kerberos5 as described in HOWTO and try to start
kadmind service.

Steps to Reproduce:
1. Configure krb5 for a domain
2. start krb5kdc
3. start kadmin service.
Actual results: Kadmin service start fails.

Expected results: Kadmin should Start

Additional info: I had to make SELinix permissive to continue.

I am sorry if I have submitted this bug badly. This is the first bug I am
submitting. I was asked to do so in the #kerberos channel of the IRC.
Comment 1 Gianluca Varisco 2007-06-21 04:36:50 EDT
Please send here the output generated in /var/log/audit/audit.log and from:

     # getsebool -a | grep krb
     # getsebool -a | grep kerb

Thank you.
Comment 2 Bharath Bhushan Lohray 2007-06-22 03:40:44 EDT
[root@bhuviyantra ~]# getsebool -a | grep krb
[root@bhuviyantra ~]# getsebool -a | grep kerb
allow_kerberos --> on
[root@bhuviyantra ~]#

Attached file : audit.log.tar.bz2

To avoid the error, I copied my words file to another folder changed it's
context to kadmin_t and pointed the configuration file to this words file.

Then again service kadmin start and [FAILED]

The error I got is

    SELinux is preventing /usr/kerberos/sbin/kadmind (kadmind_t) "read" to
    meminfo (proc_t).

Detailed Description
    SELinux denied access requested by /usr/kerberos/sbin/kadmind. It is not
    expected that this access is required by /usr/kerberos/sbin/kadmind and this
    access may signal an intrusion attempt. It is also possible that the
    specific version or configuration of the application is causing it to
    require additional access.

Allowing Access
    Sometimes labeling problems can cause SELinux denials.  You could try to
    restore the default system file context for meminfo, restorecon -v meminfo
    If this does not work, there is currently no automatic way to allow this
    access. Instead,  you can generate a local policy module to allow this
    access - see http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385 Or you
    can disable SELinux protection altogether. Disabling SELinux protection is
    not recommended. Please file a
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against this package.

Additional Information       

Source Context                root:system_r:kadmind_t
Target Context                system_u:object_r:proc_t
Target Objects                meminfo [ file ]
Affected RPM Packages         krb5-server-1.6-6 [application]
Policy RPM                    selinux-policy-2.6.4-13.fc7
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.catchall_file
Host Name                     bhuviyantra.bopal.bhuvid.in
Platform                      Linux bhuviyantra.bopal.bhuvid.in
                              2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT
                              2007 x86_64 x86_64
Alert Count                   1
First Seen                    Fri 22 Jun 2007 11:22:24 AM IST
Last Seen                     Fri 22 Jun 2007 11:22:24 AM IST
Local ID                      ff789803-b347-4a29-afe8-1eb078b64350
Line Numbers                 

Raw Audit Messages           

avc: denied { read } for comm="kadmind" dev=proc egid=0 euid=0
exe="/usr/kerberos/sbin/kadmind" exit=-13 fsgid=0 fsuid=0 gid=0 items=0
name="meminfo" pid=7413 scontext=root:system_r:kadmind_t:s0 sgid=0
subj=root:system_r:kadmind_t:s0 suid=0 tclass=file
tcontext=system_u:object_r:proc_t:s0 tty=(none) uid=0


The solutions mentioned does not work...

I am a newbie... So please excuse me if I have not submitted the info well...
Comment 3 Bharath Bhushan Lohray 2007-06-22 03:41:08 EDT
Created attachment 157600 [details]
audit.log file
Comment 4 Daniel Walsh 2007-06-22 13:49:28 EDT
First fix the file context on /var/log/kadmind.log
restorecon /var/log/kadmind.log

/var/run has bad labeled files also
restorecon -R -v /var/run

You can not chcon -t kadmin_t file.

kadmind_t is a process context not a file context.  Turns out policy is broken
here. and kadmind is not allowed to read usr_t files or symlinks.  So Selinux
policy needs to be updated.

Fixed in selinux-policy-2.6.4-22

Finally looks like you labeled / as httpd_sys_content_t.  This is wrong.

restorecon /

Comment 5 Bug Zapper 2008-05-14 09:13:22 EDT
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Bug Zapper 2008-06-16 21:40:09 EDT
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008. 
Fedora 7 is no longer maintained, which means that it will not 
receive any further security or bug fix updates. As a result we 
are closing this bug. 

If you can reproduce this bug against a currently maintained version 
of Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.