Bug 691709 - SELinux is preventing /bin/mkdir from 'mac_admin' accesses on the capability2 Unknown.
Summary: SELinux is preventing /bin/mkdir from 'mac_admin' accesses on the capability2...
Keywords:
Status: CLOSED DUPLICATE of bug 692559
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:a1834286f0a...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-29 10:18 UTC by Keith Burton
Modified: 2018-04-11 19:02 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-31 15:20:52 UTC
Type: ---


Attachments (Terms of Use)

Description Keith Burton 2011-03-29 10:18:34 UTC
SELinux is preventing /bin/mkdir from 'mac_admin' accesses on the capability2 Unknown.

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

If you believe that mkdir 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 mkdir /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:initrc_t:s0
Target Context                system_u:system_r:initrc_t:s0
Target Objects                Unknown [ capability2 ]
Source                        mkdir
Source Path                   /bin/mkdir
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           coreutils-8.10-2.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-6.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.2-8.fc15.x86_64 #1 SMP Mon
                              Mar 28 02:14:51 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Tue 29 Mar 2011 09:11:18 EST
Last Seen                     Tue 29 Mar 2011 09:11:18 EST
Local ID                      40eb772b-130d-458b-b127-f62c5c8c733d

Raw Audit Messages
type=AVC msg=audit(1301353878.116:11): avc:  denied  { mac_admin } for  pid=789 comm="mkdir" capability=33  scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=capability2


type=SYSCALL msg=audit(1301353878.116:11): arch=x86_64 syscall=write success=no exit=EINVAL a0=3 a1=a11050 a2=22 a3=7fffa0a46dc0 items=0 ppid=736 pid=789 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=mkdir exe=/bin/mkdir subj=system_u:system_r:initrc_t:s0 key=(null)

Hash: mkdir,initrc_t,initrc_t,capability2,mac_admin

audit2allow

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

audit2allow -R

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

Comment 1 Miroslav Grepl 2011-03-29 11:41:03 UTC
This error means some process running as initrc_t was trying to chcon to a context that SELinux does not understand.

What does

# ps -eZ |grep initrc_t

# rpm -qa --scripts |grep chcon

# grep -r chcon /etc/init.d/

Comment 2 Matěj Cepl 2011-03-29 18:38:36 UTC
(In reply to comment #1)
> This error means some process running as initrc_t was trying to chcon to a
> context that SELinux does not understand.
> 
> What does
> 
> # ps -eZ |grep initrc_t

nothing

> # rpm -qa --scripts |grep chcon

Slightly more complicated:

bradford:~# rpm -qa |while read PKG ; do SCRIPT=$(rpm -q --scripts $PKG);  if ( echo "$SCRIPT" | grep chcon >/dev/null 2>&1 ) ; then echo "${PKG}:"; echo $SCRIPT; fi; done
bluegriffon-0.9-0.2.svn540.fc15.x86_64:
postinstall scriptlet (using /bin/sh): chcon -t textrel_shlib_t /usr/lib64/bluegriffon/libxul.so &>/dev/null || : update-desktop-database &> /dev/null || : touch --no-create /usr/share/icons/hicolor &>/dev/null || : if [ -x /usr/bin/gtk-update-icon-cache ]; then /usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor || : fi postuninstall scriptlet (using /bin/sh): if [ $1 -eq 0 ] ; then touch --no-create /usr/share/icons/hicolor &>/dev/null gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || : fi update-desktop-database &> /dev/null || :
util-linux-2.19-3.fc15.x86_64:
postinstall scriptlet (using /bin/sh): # only for minimal buildroots without /var/log [ -d /var/log ] || /bin/mkdir -p /var/log /bin/touch /var/log/lastlog /bin/chown root:root /var/log/lastlog /bin/chmod 0644 /var/log/lastlog # Fix the file context, do not use restorecon if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then SECXT=$( /usr/sbin/matchpathcon -n /var/log/lastlog 2> /dev/null ) if [ -n "$SECXT" ]; then # Selinux enabled, but without policy? It's true for buildroots # without selinux stuff on host machine with enabled selinux. # We don't want to use any RPM dependence on selinux policy for # matchpathcon(2). SELinux policy should be optional. /usr/bin/chcon "$SECXT" /var/log/lastlog >/dev/null 2>&1 || : fi fi rm -f /etc/mtab ln -s /proc/mounts /etc/mtab
bradford:~# 

Bluegriffon is almost certainly innocent, I tried to install it almost month ago, and then I haven't touched it at all.


> # grep -r chcon /etc/init.d/

nothing

Comment 3 Andrew Ross 2011-03-30 10:21:52 UTC
(In reply to comment #1)
> This error means some process running as initrc_t was trying to chcon to a
> context that SELinux does not understand.
> 
> What does
> 
> # ps -eZ |grep initrc_t
> 

Nothing

> # rpm -qa --scripts |grep chcon
>

/usr/bin/chcon "$SECXT"  /var/log/lastlog >/dev/null 2>&1 || :

 
> # grep -r chcon /etc/init.d/

Nothing.

Not sure if it's relevant, but this occurred during yum update. Noticed the following message:

  Cleanup    : mdadm-3.1.3-0.git20100804.2.fc15.x86_64                          133/182 
Non-fatal POSTUN scriptlet failure in rpm package mdadm
  Cleanup    : nc-1.84-25.fc15.x86_64                                           134/182 
warning: %postun(mdadm-3.1.3-0.git20100804.2.fc15.x86_64) scriptlet failed, exit status 1

Comment 4 Miroslav Grepl 2011-03-30 13:18:10 UTC
Ok, I have just updated and I am getting the same.

Comment 5 Miroslav Grepl 2011-03-31 15:20:52 UTC

*** This bug has been marked as a duplicate of bug 692559 ***


Note You need to log in before you can comment on or make changes to this bug.