Bug 856488

Summary: AVCs when running udevd test with disabled unconfined and unlabelednet
Product: Red Hat Enterprise Linux 6 Reporter: Michal Trunecka <mtruneck>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Michal Trunecka <mtruneck>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: dwalsh, ebenes, mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-04 07:59:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Trunecka 2012-09-12 06:58:59 UTC
Description of problem:
Selinux blocks running udevd (start_udev) and reported AVCs when unconfined and unlabelednet selinux modules are disabled. The pest passes without any AVC when both modules are enabled.


AVCs in permissive mode:

----
time->Wed Sep 12 08:34:44 2012
type=PATH msg=audit(1347431684.203:5228): item=2 name=(null) inode=327047 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0
type=PATH msg=audit(1347431684.203:5228): item=1 name=(null) inode=156823 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:shell_exec_t:s0
type=PATH msg=audit(1347431684.203:5228): item=0 name="/sbin/start_udev" inode=6076 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:udev_exec_t:s0
type=CWD msg=audit(1347431684.203:5228):  cwd="/"
type=EXECVE msg=audit(1347431684.203:5228): argc=3 a0="/bin/bash" a1="/sbin/start_udev"
type=EXECVE msg=audit(1347431684.203:5228): argc=4 a0="/bin/bash" a1="/sbin/start_udev"
type=SYSCALL msg=audit(1347431684.203:5228): arch=c000003e syscall=59 success=yes exit=0 a0=7fffa993018a a1=7fffa9930360 a2=7fffa9930380 a3=7fffa992ffc0 items=3 ppid=20131 pid=20132 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts6 ses=3 comm="start_udev" exe="/bin/bash" subj=system_u:system_r:initrc_t:s0 key=(null)
type=AVC msg=audit(1347431684.203:5228): avc:  denied  { entrypoint } for  pid=20132 comm="run_init" path="/sbin/start_udev" dev=sda3 ino=6076 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:udev_exec_t:s0 tclass=file
----
time->Wed Sep 12 08:34:44 2012
type=PATH msg=audit(1347431684.251:5229): item=0 name="/proc/kcore" inode=4026532037 dev=00:03 mode=0100400 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:proc_kcore_t:s0
type=CWD msg=audit(1347431684.251:5229):  cwd="/"
type=SYSCALL msg=audit(1347431684.251:5229): arch=c000003e syscall=4 success=yes exit=0 a0=7fff8dd4c608 a1=7fff8dd4bb40 a2=7fff8dd4bb40 a3=a items=1 ppid=20132 pid=20153 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts6 ses=3 comm="ln" exe="/bin/ln" subj=system_u:system_r:initrc_t:s0 key=(null)
type=AVC msg=audit(1347431684.251:5229): avc:  denied  { getattr } for  pid=20153 comm="ln" path="/proc/kcore" dev=proc ino=4026532037 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:proc_kcore_t:s0 tclass=file


Version-Release number of selected component (if applicable):
udev-147-2.42.el6.x86_64
selinux-policy-3.7.19-161.el6.noarch
selinux-policy-minimum-3.7.19-161.el6.noarch
selinux-policy-targeted-3.7.19-161.el6.noarch
selinux-policy-mls-3.7.19-161.el6.noarch
selinux-policy-doc-3.7.19-161.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. semodule -d unconfined; semoudle -d unlabelednet
2. killall udevd
3. run_init start_udev

  
Actual results:
execvp: Permission denied
and AVCs are reported

Expected results:
udevd is started without AVCs

Comment 2 Miroslav Grepl 2012-10-15 18:06:00 UTC
Michal,
could you ping me to discuss this issue.

Comment 3 Daniel Walsh 2012-10-16 12:17:15 UTC
What service is using run_init?

Comment 4 Daniel Walsh 2012-10-16 12:17:56 UTC
Maybe change it to run_init sh -c start_udev, or we don't need run_init.

Comment 5 Miroslav Grepl 2012-10-16 12:21:16 UTC
Exactly. I believe we don't need run_init.

Comment 6 Miroslav Grepl 2013-01-04 07:59:57 UTC
Michal,
please reopen if you don't agree.