Bug 1143799 - policy applied with semodule is not taking effect
Summary: policy applied with semodule is not taking effect
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 20
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-18 03:40 UTC by Dan Mossor [danofsatx]
Modified: 2015-06-30 01:37 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.12.1-186.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-30 01:37:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dan Mossor [danofsatx] 2014-09-18 03:40:49 UTC
Description of problem:
sensord is being denied access to /proc/loadavg. I have run audit2allow and semodule countless times trying to fix this, and get no errors when I do, but the policy is not being applied.

Version-Release number of selected component (if applicable):
lm_sensors-sensord-3.3.4-10.fc20.x86_64
selinux-policy-3.12.1-182.fc20.noarch
policycoreutils-python-2.2.5-4.fc20.x86_64
policycoreutils-2.2.5-4.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Install lmsensors-sensord
2. Configure sensord to read the loadaverage
3. start sensord

Actual results:
journal fills up with AVC denials for sensord reading /proc/loadavg

Expected results:
quiet journal, loadaverage readings being recorded in sensord database.

Additional info:
sealert for (one of) the incidents:

[root@repohost ~]# sealert -l cf9056f1-ef5e-44e9-aaaa-b7d2125a43f1
SELinux is preventing /usr/sbin/sensord.#prelink#.eHFdJ5 (deleted) from getattr access on the file .

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

If you believe that sensord.#prelink#.eHFdJ5 (deleted) should be allowed getattr access on the  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 sensord /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


Additional Information:
Source Context                system_u:system_r:sensord_t:s0
Target Context                system_u:object_r:proc_t:s0
Target Objects                 [ file ]
Source                        sensord
Source Path                   /usr/sbin/sensord.#prelink#.eHFdJ5 (deleted)
Port                          <Unknown>
Host                          repohost.localdomain.net
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-182.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     repohost.localdomain.net
Platform                      Linux repohost.localdomain.net 3.15.10-201.fc20.x86_64
                              #1 SMP Wed Aug 27 21:10:06 UTC 2014 x86_64 x86_64
Alert Count                   4
First Seen                    2014-09-17 22:24:00 CDT
Last Seen                     2014-09-17 22:27:00 CDT
Local ID                      cf9056f1-ef5e-44e9-aaaa-b7d2125a43f1

Raw Audit Messages
type=AVC msg=audit(1411010820.596:34291): avc:  denied  { getattr } for  pid=523 comm="sensord" path="/proc/loadavg" dev="proc" ino=4026532000 scontext=system_u:system_r:sensord_t:s0 tcontext=system_u:object_r:proc_t:s0 tclass=file


type=SYSCALL msg=audit(1411010820.596:34291): arch=x86_64 syscall=fstat success=no exit=EACCES a0=1 a1=7fff5d2e3440 a2=7fff5d2e3440 a3=7f48392419c0 items=0 ppid=1 pid=523 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sensord exe=2F7573722F7362696E2F73656E736F72642E237072656C696E6B232E654846644A35202864656C6574656429 subj=system_u:system_r:sensord_t:s0 key=(null)

Hash: sensord,sensord_t,proc_t,file,getattr

Comment 1 Lukas Vrabec 2014-09-22 09:07:46 UTC
commit 1de9e6691094b4269cb764484014746583221f70
Author: Lukas Vrabec <lvrabec>
Date:   Mon Sep 22 10:59:47 2014 +0200

    Allow sensord read in /proc BZ(#1143799)

https://github.com/selinux-policy/selinux-policy/commit/1de9e6691094b4269cb764484014746583221f70

Comment 2 Miroslav Grepl 2014-09-22 09:52:46 UTC
The point is you need to have all AVC msgs from permissive mode to create a local policy. So you would need to run

# semanage permissive -a sensord_t

re-test

# grep sensord_t /var/log/audit/audit.log |audit2allow -M mypol
# semodule -i mypol.pp
# semanage permissive -d sensord_t

Comment 3 Fedora Update System 2014-09-23 08:29:45 UTC
selinux-policy-3.12.1-186.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-186.fc20

Comment 4 Fedora Update System 2014-09-25 10:45:15 UTC
Package selinux-policy-3.12.1-186.fc20:
* should fix your issue,
* was pushed to the Fedora 20 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.12.1-186.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-11479/selinux-policy-3.12.1-186.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-09-25 16:57:59 UTC
selinux-policy-3.12.1-187.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-187.fc20

Comment 6 Fedora Update System 2014-09-30 08:36:50 UTC
selinux-policy-3.12.1-188.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-188.fc20

Comment 7 Fedora End Of Life 2015-05-29 12:54:47 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 EOL if it remains open with a Fedora  'version'
of '20'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 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  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 8 Fedora End Of Life 2015-06-30 01:37:25 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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.