Bug 883422 - tuned: please fix selinux AVCs for generated profiles
Summary: tuned: please fix selinux AVCs for generated profiles
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-04 15:04 UTC by Jaroslav Škarvada
Modified: 2012-12-07 04:29 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-12-07 04:29:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jaroslav Škarvada 2012-12-04 15:04:46 UTC
Description of problem:
There are AVCs for generated profiles.

Version-Release number of selected component (if applicable):
tuned-2.1.0-1
selinux-policy-3.11.1-59

How reproducible:
Always

Steps to Reproduce:
1. powertop2tuned -f test
2. tuned-adm profile test
3. tuned profile test
  
Actual results:
AVC

Expected results:
No AVC

Additional info:
type=AVC msg=audit(1354631821.314:372): avc:  denied  { execute } for  pid=3187 comm="tuned" name="script.sh" dev="sda2" ino=789374 scontext=system_u:system_r:tuned_t:s0 tcontext=unconfined_u:object_r:tuned_etc_t:s0 tclass=file
type=AVC msg=audit(1354631821.314:372): avc:  denied  { execute_no_trans } for  pid=3187 comm="tuned" path="/etc/tuned/test/script.sh" dev="sda2" ino=789374 scontext=system_u:system_r:tuned_t:s0 tcontext=unconfined_u:object_r:tuned_etc_t:s0 tclass=file
type=SYSCALL msg=audit(1354631821.314:372): arch=40000003 syscall=11 success=yes exit=0 a0=b5401768 a1=b540b448 a2=bfcb7a98 a3=b540b450 items=0 ppid=3184 pid=3187 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="script.sh" exe="/usr/bin/bash" subj=system_u:system_r:tuned_t:s0 key=(null)

Generated profiles are stored under /etc/tuned/. Every profile is directory. From the profiles custom commands can be execued. Theoretically any custom command can be executed but our powertop2tuned tool only generates bash scripts that are called script.sh. The script.sh is stored in the profile directory. I think it should be enough to add support only for this pattern.

Comment 1 Miroslav Grepl 2012-12-04 15:18:26 UTC
Who does it generate? I mean these profiles located in the /etc/tuned.

These scripts needs to be labeled as bin_t.

Comment 2 Jaroslav Škarvada 2012-12-04 15:20:21 UTC
(In reply to comment #1)
> Who does it generate? I mean these profiles located in the /etc/tuned.
> 
> These scripts needs to be labeled as bin_t.

/usr/bin/powertop2tuned

Comment 3 Miroslav Grepl 2012-12-04 16:21:19 UTC
Ok and it is started by a user?

Comment 4 Jaroslav Škarvada 2012-12-04 16:37:59 UTC
It needs to be started by root to create profile in /etc/tuned.

Regular user can use the tool, to generate profiles locally (or everywhere the user has write permission). This functionality is e.g. for debug/analysis. Such profiles aren't used by tuned.

Comment 5 Miroslav Grepl 2012-12-05 06:51:31 UTC
commit b31836ca079a93ab9636135c376c0a0829580723
Author: Miroslav Grepl <mgrepl>
Date:   Wed Dec 5 07:49:14 2012 +0100

    Allow tuned to execute profiles scripts in /etc/tuned

Comment 6 Fedora Update System 2012-12-06 10:13:16 UTC
selinux-policy-3.11.1-60.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2012-19374/selinux-policy-3.11.1-60.fc18

Comment 7 Fedora Update System 2012-12-06 20:10:02 UTC
Package selinux-policy-3.11.1-60.fc18:
* should fix your issue,
* was pushed to the Fedora 18 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.11.1-60.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-19374/selinux-policy-3.11.1-60.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-12-07 04:29:16 UTC
selinux-policy-3.11.1-60.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


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