Bug 817761 - SELinux is preventing /bin/bash from 'open' accesses on the file /bin/systemctl.
SELinux is preventing /bin/bash from 'open' accesses on the file /bin/systemctl.
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-05-01 03:22 EDT by Frank Murphy
Modified: 2013-02-13 13:55 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-13 13:55:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Local te file (24 bytes, text/plain)
2012-05-01 03:26 EDT, Frank Murphy
no flags Details

  None (edit)
Description Frank Murphy 2012-05-01 03:22:03 EDT
libreport version: 2.0.8
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.3.4-1.fc16.x86_64
reason:         SELinux is preventing /bin/bash from 'open' accesses on the file /bin/systemctl.
time:           Tue 01 May 2012 08:21:46 IST

:SELinux is preventing /bin/bash from 'open' accesses on the file /bin/systemctl.
:*****  Plugin catchall (100. confidence) suggests  ***************************
:If you believe that bash should be allowed open access on the systemctl file by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:allow this access for now by executing:
:# grep sh /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:Additional Information:
:Source Context                system_u:system_r:freshclam_t:s0-s0:c0.c1023
:Target Context                system_u:object_r:systemd_systemctl_exec_t:s0
:Target Objects                /bin/systemctl [ file ]
:Source                        sh
:Source Path                   /bin/bash
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           bash-4.2.24-2.fc16.x86_64
:Target RPM Packages           systemd-units-37-19.fc16.x86_64
:Policy RPM                    selinux-policy-3.10.0-86.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.4-1.fc16.x86_64 #1
:                              SMP Fri Apr 27 20:12:28 UTC 2012 x86_64 x86_64
:Alert Count                   5
:First Seen                    Tue 01 May 2012 00:12:15 IST
:Last Seen                     Tue 01 May 2012 06:12:17 IST
:Local ID                      afc4c2d4-1c6f-45ee-b017-e1a1a9bc1aa4
:Raw Audit Messages
:type=AVC msg=audit(1335849137.59:259): avc:  denied  { open } for  pid=4849 comm="sh" name="systemctl" dev="vda3" ino=16154 scontext=system_u:system_r:freshclam_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file
:type=SYSCALL msg=audit(1335849137.59:259): arch=x86_64 syscall=open success=no exit=EACCES a0=23ca820 a1=0 a2=43 a3=7fff0cb7df60 items=0 ppid=4846 pid=4849 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=22 comm=sh exe=/bin/bash subj=system_u:system_r:freshclam_t:s0-s0:c0.c1023 key=(null)
:Hash: sh,freshclam_t,systemd_systemctl_exec_t,file,open
:#============= freshclam_t ==============
:allow freshclam_t systemd_systemctl_exec_t:file open;
:audit2allow -R
:#============= freshclam_t ==============
:allow freshclam_t systemd_systemctl_exec_t:file open;
Comment 1 Frank Murphy 2012-05-01 03:24:23 EDT
Attempt to create local rule fails:

grep sh /var/log/audit/audit.log | audit2allow -M F16sh03
compilation failed:
F16sh03.te:6:ERROR 'syntax error' at token '' on line 6:

/usr/bin/checkmodule:  error(s) encountered while parsing configuration
/usr/bin/checkmodule:  loading policy configuration from F16sh03.te
Comment 2 Frank Murphy 2012-05-01 03:26:03 EDT
Created attachment 581308 [details]
Local te file
Comment 3 Daniel Walsh 2012-05-01 18:51:23 EDT
Looks like the avc is no longer in the audit.log, it might have been rolled.

ausearch -m avc | audit2allow -M F16sh03

But what exactly is freshclam trying to execute systemctl?
Comment 4 Frank Murphy 2012-05-01 19:10:44 EDT
from freshclam.conf

# Send the RELOAD command to clamd.
# Default: no
NotifyClamd /etc/clamd.d/clamav.conf

It makes clamd-* aware of and reloads it with the new bases,
guessing in this instance it runs:
systemctl reload clamd.clamav.service

avcs only recently showing up in F16, worked "reloading clamd" 
since F16 GA, without the avc's.
Comment 5 Fedora End Of Life 2013-01-16 10:45:22 EST
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. 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 '16'.

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 16'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 16 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, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

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.

The process we are following is described here: 
Comment 6 Fedora End Of Life 2013-02-13 13:55:12 EST
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 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.

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