Bug 834143

Summary: SELinux is preventing /usr/bin/python2.7 from 'execute' accesses on the file /etc/tuned/macbook/script.sh.
Product: [Fedora] Fedora Reporter: ngativ
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:7d626e3018b2f00eb451e15e81d0bd456b2c26b8ab0d832fe9ed79831090060b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-30 21:51:56 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 ngativ 2012-06-21 00:35:52 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.4.2-4.fc17.x86_64
time:           Wed 20 Jun 2012 07:34:51 PM CDT

description:
:SELinux is preventing /usr/bin/python2.7 from 'execute' accesses on the file /etc/tuned/macbook/script.sh.
:
:*****  Plugin leaks (86.2 confidence) suggests  ******************************
:
:If you want to ignore python2.7 trying to execute access the script.sh file, because you believe it should not need this access.
:Then you should report this as a bug.  
:You can generate a local policy module to dontaudit this access.
:Do
:# grep /usr/bin/python2.7 /var/log/audit/audit.log | audit2allow -D -M mypol
:# semodule -i mypol.pp
:
:*****  Plugin catchall (14.7 confidence) suggests  ***************************
:
:If you believe that python2.7 should be allowed execute access on the script.sh file 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 tuned /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                unconfined_u:object_r:etc_t:s0
:Target Objects                /etc/tuned/macbook/script.sh [ file ]
:Source                        tuned
:Source Path                   /usr/bin/python2.7
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           python-2.7.3-6.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-132.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.2-4.fc17.x86_64 #1 SMP Thu
:                              Jun 14 22:22:05 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    Thu 21 Jun 2012 12:33:15 AM CDT
:Last Seen                     Thu 21 Jun 2012 12:33:15 AM CDT
:Local ID                      f49eeac3-8ea8-4832-b1b3-0f41dfd26d2e
:
:Raw Audit Messages
:type=AVC msg=audit(1340256795.795:52): avc:  denied  { execute } for  pid=969 comm="tuned" name="script.sh" dev="sda6" ino=660944 scontext=system_u:system_r:tuned_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1340256795.795:52): arch=x86_64 syscall=execve success=no exit=EACCES a0=7f8ba40037a0 a1=7f8ba4003ec0 a2=7fff5fa0bea8 a3=20 items=0 ppid=574 pid=969 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=tuned exe=/usr/bin/python2.7 subj=system_u:system_r:tuned_t:s0 key=(null)
:
:Hash: tuned,tuned_t,etc_t,file,execute
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 ngativ 2012-06-21 00:47:18 UTC
I just made a tuned script using powertop2tuned.

Everytime a reboot selinux complains about the script being executed by tuned (python). And i have to "grep tuned /var/log/audit/audit.log | audit2allow -M mypol ;  semodule -i mypol.pp"

I gave up and disabled selinux

Comment 2 Miroslav Grepl 2012-06-21 05:53:47 UTC
You can fix it using

# chcon -t bin_t /etc/tuned/macbook/script.sh

Fixed in selinux-policy-3.10.0-133.fc17.noarch

Comment 3 ngativ 2012-06-21 14:28:06 UTC
Thanks! i am new to fedora and selinux

Comment 4 Fedora Update System 2012-06-26 21:48:08 UTC
selinux-policy-3.10.0-134.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-134.fc17

Comment 5 Fedora Update System 2012-06-28 03:38:20 UTC
Package selinux-policy-3.10.0-134.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-134.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-10008/selinux-policy-3.10.0-134.fc17
then log in and leave karma (feedback).

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