Bug 908240 - SELinux is preventing /usr/sbin/mdadm from 'getattr' accesses on the chr_file /dev/mem.
Summary: SELinux is preventing /usr/sbin/mdadm from 'getattr' accesses on the chr_file...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:df053ea38bce68ac22bbab8e937...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-06 08:51 UTC by Frank Murphy
Modified: 2013-02-11 12:32 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-02-11 12:32:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
audit.log (3.18 MB, text/plain)
2013-02-06 08:58 UTC, Frank Murphy
no flags Details

Description Frank Murphy 2013-02-06 08:51:29 UTC
Description of problem:
SELinux is preventing /usr/sbin/mdadm from 'getattr' accesses on the chr_file /dev/mem.

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

If you believe that mdadm should be allowed getattr access on the mem chr_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 mdadm /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:logwatch_t:s0-s0:c0.c1023
Target Context                system_u:object_r:memory_device_t:s0
Target Objects                /dev/mem [ chr_file ]
Source                        mdadm
Source Path                   /usr/sbin/mdadm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           mdadm-3.2.6-12.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-73.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.6-201.fc18.x86_64 #1 SMP Mon
                              Feb 4 15:54:08 UTC 2013 x86_64 x86_64
Alert Count                   7
First Seen                    2013-02-06 08:07:07 GMT
Last Seen                     2013-02-06 08:07:25 GMT
Local ID                      34294d29-9e36-438a-a692-8b549bc40615

Raw Audit Messages
type=AVC msg=audit(1360138045.80:5630): avc:  denied  { getattr } for  pid=2652 comm="mdadm" path="/dev/mem" dev="devtmpfs" ino=4528 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=system_u:object_r:memory_device_t:s0 tclass=chr_file


type=SYSCALL msg=audit(1360138045.80:5630): arch=x86_64 syscall=newfstatat success=no exit=EACCES a0=3 a1=25b9b53 a2=7fff26071140 a3=100 items=0 ppid=2651 pid=2652 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4 tty=(none) comm=mdadm exe=/usr/sbin/mdadm subj=system_u:system_r:logwatch_t:s0-s0:c0.c1023 key=(null)

Hash: mdadm,logwatch_t,memory_device_t,chr_file,getattr

audit2allow

#============= logwatch_t ==============
allow logwatch_t memory_device_t:chr_file getattr;

audit2allow -R

#============= logwatch_t ==============
allow logwatch_t memory_device_t:chr_file getattr;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.6-201.fc18.x86_64
type:           libreport

Comment 1 Frank Murphy 2013-02-06 08:53:26 UTC
This is just a sample to create a bz, have started to get 30-40 avcs, 
with mdadm as the common component.

rpm -qa | grep selinux
selinux-policy-doc-3.11.1-73.fc18.noarch
libselinux-python-2.1.12-7.fc18.x86_64
libselinux-2.1.12-7.fc18.x86_64
selinux-policy-targeted-3.11.1-73.fc18.noarch
libselinux-utils-2.1.12-7.fc18.x86_64
selinux-policy-3.11.1-73.fc18.noarch
selinux-policy-devel-3.11.1-73.fc18.noarch

Comment 2 Frank Murphy 2013-02-06 08:58:42 UTC
Created attachment 693796 [details]
audit.log

Had to upload audit.log, as kept using wrong syntax with ausearch:
ausearch -c mdadm 2>&1 ausearch.log
ausearch.log is an unsupported option

Comment 3 Miroslav Grepl 2013-02-06 08:58:51 UTC
Could you please use the latest policy from updates-testing

# yum update selinux-policy-targeted --enablerepo=updates-testing

Comment 4 Frank Murphy 2013-02-06 10:09:30 UTC
(In reply to comment #3)
> Could you please use the latest policy from updates-testing
> 
> # yum update selinux-policy-targeted --enablerepo=updates-testing

No change:
~$ rpm -qa | grep selinux
selinux-policy-doc-3.11.1-73.fc18.noarch
libselinux-python-2.1.12-7.fc18.x86_64
selinux-policy-targeted-3.11.1-74.fc18.noarch
libselinux-2.1.12-7.fc18.x86_64
libselinux-utils-2.1.12-7.fc18.x86_64
selinux-policy-3.11.1-74.fc18.noarch
selinux-policy-devel-3.11.1-73.fc18.noarch

Changed logwatch to run hourly, to prevent waiting a day fro result.
logwatch-7.4.0-23.20130102svn127.fc18.noarch

Comment 5 Miroslav Grepl 2013-02-06 10:14:41 UTC
Ok, please use the latest build from koji for now

http://koji.fedoraproject.org/koji/buildinfo?buildID=382238

Comment 6 Frank Murphy 2013-02-10 09:56:19 UTC
(In reply to comment #5)
> Ok, please use the latest build from koji for now
> 
> http://koji.fedoraproject.org/koji/buildinfo?buildID=382238

That seems to have fixed it.


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