Bug 672382

Summary: SELinux is preventing /usr/bin/chcon from 'mac_admin' accesses on the capability2 Unknown.
Product: [Fedora] Fedora Reporter: Bob Gustafson <bobgus>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: blackcode, dwalsh, mgrepl, old.uncle.z, renich
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:4b2836aaae5f8a6b2910ce9e37529854d3c26f7aee986b386d8fea9801a94701
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-25 08:50:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bob Gustafson 2011-01-25 00:36:23 UTC
SELinux is preventing /usr/bin/chcon from 'mac_admin' accesses on the capability2 Unknown.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that chcon should be allowed mac_admin access on the Unknown capability2 by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep chcon /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                Unknown [ capability2 ]
Source                        chcon
Source Path                   /usr/bin/chcon
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.5-7.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-20.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.10-74.fc14.x86_64 #1
                              SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   4
First Seen                    Thu 20 Jan 2011 02:32:25 PM CST
Last Seen                     Thu 20 Jan 2011 02:39:27 PM CST
Local ID                      098033e6-ee16-42b6-9719-e3e4dd89458c

Raw Audit Messages
type=AVC msg=audit(1295555967.501:41300): avc:  denied  { mac_admin } for  pid=4672 comm="chcon" capability=33  scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=capability2

chcon,unconfined_t,unconfined_t,capability2,mac_admin
type=SYSCALL msg=audit(1295555967.501:41300): arch=x86_64 syscall=lsetxattr success=no exit=EINVAL a0=25e00e0 a1=362d415995 a2=25e2a30 a3=25 items=0 ppid=4614 pid=4672 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=1 comm=chcon exe=/usr/bin/chcon subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
chcon,unconfined_t,unconfined_t,capability2,mac_admin

#============= unconfined_t ==============
allow unconfined_t self:capability2 mac_admin;

Comment 1 Bob Gustafson 2011-01-25 00:39:32 UTC
Pretty skimpy information - Unknown...

I did not open up SELinux to this request.

My system did not crash, the sky is not falling, etc.

I was sending an email near the moment I was notified of the problem.

---

My email was sent.

Comment 2 Miroslav Grepl 2011-01-25 08:50:53 UTC
Did you execute the 'chcon' command?  This means you tried to set a context via
chcon that the kernel/policy does not know about.

For example:

chcon -t abc_exec_t /bin/ps

Comment 3 Daniel Walsh 2011-01-25 14:10:41 UTC
Possible other apps that could cause this would be

livecd, rpm/yum,  mock?

Comment 4 Bob Gustafson 2011-01-25 14:52:09 UTC
It might have been caused by me - using chcon with an erroneous argument.

I was executing a 'fix' chcon line in response to a suggestion in another bug report. I haven't checked the timing, but this bug may have been caused by that command.

Comment 5 Daniel Walsh 2011-01-25 15:27:03 UTC
Ok, sadly making a mistake in a chcon will cause this issue.  It is usually  better to execute 

semanage fcontext -t abc_exec_t PATH
restorecon PATH

Then to use chcon.

Comment 6 Bob Gustafson 2011-05-02 12:42:23 UTC
As I remember, the syntax and content of the chcon command I executed was recommended by a se tool in response to another se problem.

If there is a better command syntax, then that better syntax should be incorporated into the se tools for execution by future sysadmins.

Comment 7 Daniel Walsh 2011-05-03 15:20:06 UTC
If you can grab the output from I would figure setroubleshoot, I would love to look at it?