Bug 836755

Summary: SELinux is preventing /usr/sbin/sysctl from using the 'sys_admin' capabilities.
Product: [Fedora] Fedora Reporter: Daniel Rindt <drindt>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:3a9d2b3e0970a509487be99d0f427aad25d44299b8a5ec55f866c9d518da338a
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-21 22:51:17 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 Daniel Rindt 2012-06-30 23:13:23 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.4.4-3.fc17.x86_64
time:           So 01 Jul 2012 01:13:06 CEST

description:
:SELinux is preventing /usr/sbin/sysctl from using the 'sys_admin' capabilities.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If sie denken, dass sysctl standardmäßig sys_admin Berechtigung haben sollten.
:Then sie sollten dies als Fehler melden.
:Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
:Do
:zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
:# grep sysctl /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:tuned_t:s0
:Target Context                system_u:system_r:tuned_t:s0
:Target Objects                 [ capability ]
:Source                        sysctl
:Source Path                   /usr/sbin/sysctl
:Port                          <Unbekannt>
:Host                          (removed)
:Source RPM Packages           procps-3.2.8-26.20110302git.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-134.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.3-1.fc17.x86_64 #1
:                              SMP Mon Jun 18 19:53:17 UTC 2012 x86_64 x86_64
:Alert Count                   2
:First Seen                    Sa 30 Jun 2012 00:52:52 CEST
:Last Seen                     So 01 Jul 2012 01:10:50 CEST
:Local ID                      0a262508-dfea-4ef6-8a97-ff30b42ee426
:
:Raw Audit Messages
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_admin } for  pid=19787 comm="sysctl" capability=21  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_nice } for  pid=19787 comm="sysctl" capability=23  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_admin } for  pid=19787 comm="sysctl" capability=21  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_nice } for  pid=19787 comm="sysctl" capability=23  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_admin } for  pid=19787 comm="sysctl" capability=21  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_nice } for  pid=19787 comm="sysctl" capability=23  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_admin } for  pid=19787 comm="sysctl" capability=21  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=AVC msg=audit(1341097850.668:295): avc:  denied  { sys_nice } for  pid=19787 comm="sysctl" capability=23  scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:system_r:tuned_t:s0 tclass=capability
:
:
:type=SYSCALL msg=audit(1341097850.668:295): arch=x86_64 syscall=write success=yes exit=ENOENT a0=5 a1=7fe79f255000 a2=2 a3=402060 items=0 ppid=690 pid=19787 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sysctl exe=/usr/sbin/sysctl subj=system_u:system_r:tuned_t:s0 key=(null)
:
:Hash: sysctl,tuned_t,tuned_t,capability,sys_admin
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Miroslav Grepl 2012-07-01 21:23:26 UTC
What did you setup in the tuned to get these AVC msgs?

Comment 2 Daniel Rindt 2012-07-06 12:13:01 UTC
[root@localhost ~]# cat /usr/lib/tuned/powersave/tuned.conf
#
# tuned configuration
#

[cpu]

[eeepc_she]

[disk]
# Comma separated list of devices, all devices if commented out.
devices=sda,sdb,sdc

[net]
# Comma separated list of devices, all devices if commented out.
devices=p3p1,wlan0

[sysctl]
vm.laptop_mode=5
vm.dirty_writeback_centisecs=1500
kernel.nmi_watchdog=0

[script]
script=script.sh

Comment 3 Daniel Walsh 2012-07-11 01:25:27 UTC
I think we should add these privs.

Comment 4 Daniel Rindt 2012-07-11 04:39:21 UTC
Is this fixed already? The question results because i didn't get the sealert anymore.

Comment 5 Miroslav Grepl 2012-07-11 09:06:33 UTC
Fixed in selinux-policy-3.10.0-138.fc17

Comment 6 Fedora Update System 2012-07-18 13:04:08 UTC
selinux-policy-3.10.0-140.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-140.fc17

Comment 7 Fedora Update System 2012-07-19 09:10:59 UTC
Package selinux-policy-3.10.0-140.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-140.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-10840/selinux-policy-3.10.0-140.fc17
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-07-21 22:51:17 UTC
selinux-policy-3.10.0-140.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.