Bug 570210 - SELinux is preventing /bin/ps "read" access on stat.
Summary: SELinux is preventing /bin/ps "read" access on stat.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:591d4aa829b...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-03 16:13 UTC by Matt Castelein
Modified: 2010-03-12 20:23 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.6.32-99.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-12 04:24:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Matt Castelein 2010-03-03 16:13:24 UTC
Summary:

SELinux is preventing /bin/ps "read" access on stat.

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux denied access requested by ps. It is not expected that this access is
required by ps and this access may signal an intrusion attempt. It is also
possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                unconfined_u:system_r:ipsec_mgmt_t:s0
Target Context                system_u:system_r:init_t:s0
Target Objects                stat [ file ]
Source                        ps
Source Path                   /bin/ps
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           procps-3.2.8-3.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-92.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux arturo.coldnuke.dyndns.org
                              2.6.31.12-174.2.22.fc12.x86_64 #1 SMP Fri Feb 19
                              18:55:03 UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Mon 01 Mar 2010 03:02:14 PM EST
Last Seen                     Mon 01 Mar 2010 03:02:14 PM EST
Local ID                      0393779f-4d4f-4a5e-9a5d-19bbf1293abf
Line Numbers                  

Raw Audit Messages            

node=arturo.coldnuke.dyndns.org type=AVC msg=audit(1267473734.964:10472): avc:  denied  { read } for  pid=11195 comm="ps" name="stat" dev=proc ino=82250 scontext=unconfined_u:system_r:ipsec_mgmt_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file

node=arturo.coldnuke.dyndns.org type=AVC msg=audit(1267473734.964:10472): avc:  denied  { open } for  pid=11195 comm="ps" name="stat" dev=proc ino=82250 scontext=unconfined_u:system_r:ipsec_mgmt_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file

node=arturo.coldnuke.dyndns.org type=SYSCALL msg=audit(1267473734.964:10472): arch=c000003e syscall=2 success=yes exit=5 a0=3884e11840 a1=0 a2=0 a3=fffffffc items=0 ppid=11189 pid=11195 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1644 comm="ps" exe="/bin/ps" subj=unconfined_u:system_r:ipsec_mgmt_t:s0 key=(null)



Hash String generated from  catchall,ps,ipsec_mgmt_t,init_t,file,read
audit2allow suggests:

#============= ipsec_mgmt_t ==============
allow ipsec_mgmt_t init_t:file { read open };

Comment 1 Daniel Walsh 2010-03-03 16:21:20 UTC
In enforcing mode this would not happen since the listing would have been blocked.

But Miroslav add

domain_dontaudit_read_all_domains_state(ipsec_mgmt_t)

Comment 2 Miroslav Grepl 2010-03-04 16:00:41 UTC
Fixed in selinux-policy-3.6.32-98.fc12

Comment 3 Fedora Update System 2010-03-05 16:54:36 UTC
selinux-policy-3.6.32-99.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-99.fc12

Comment 4 Fedora Update System 2010-03-09 03:21:40 UTC
selinux-policy-3.6.32-99.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-99.fc12

Comment 5 Fedora Update System 2010-03-12 04:23:04 UTC
selinux-policy-3.6.32-99.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Matt Castelein 2010-03-12 19:11:43 UTC
What about:

SELinux is preventing /bin/ps "sys_ptrace" access .

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux denied access requested by ps. It is not expected that this access is
required by ps and this access may signal an intrusion attempt. It is also
possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                unconfined_u:system_r:ipsec_mgmt_t:s0
Target Context                unconfined_u:system_r:ipsec_mgmt_t:s0
Target Objects                None [ capability ]
Source                        ps
Source Path                   /bin/ps
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           procps-3.2.8-3.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-99.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.32.9-70.fc12.x86_64 #1 SMP Wed Mar 3 04:40:41
                              UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Fri 12 Mar 2010 02:07:52 PM EST
Last Seen                     Fri 12 Mar 2010 02:07:52 PM EST
Local ID                      d6d71105-044a-4bc2-8410-25b858699f6b
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1268420872.140:240): avc:  denied  { sys_ptrace } for  pid=11555 comm="ps" capability=19  scontext=unconfined_u:system_r:ipsec_mgmt_t:s0 tcontext=unconfined_u:system_r:ipsec_mgmt_t:s0 tclass=capability

node=(removed) type=SYSCALL msg=audit(1268420872.140:240): arch=c000003e syscall=0 success=yes exit=230 a0=5 a1=3884e118a0 a2=3ff a3=fffffffc items=0 ppid=11550 pid=11555 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=27 comm="ps" exe="/bin/ps" subj=unconfined_u:system_r:ipsec_mgmt_t:s0 key=(null)

Comment 7 Daniel Walsh 2010-03-12 19:26:36 UTC
Kernel guys, is there any reason ps should be able to trigger this on F12?

Comment 8 Daniel Walsh 2010-03-12 19:28:27 UTC
Is this caused because ps hit /proc/self/mem?

Comment 9 Stephen Smalley 2010-03-12 20:06:26 UTC
ps can still trigger sys_ptrace / CAP_SYS_PTRACE whenever it tries to read various files under /proc/pid for a process with a different uid/gid/capabilities or non-dumpable.  That's a DAC check and hasn't changed.
What has changed is that SELinux is back to only checking :file read to the /proc/pid inode for /proc/pid files other than /proc/pid/mem, and only checks :process ptrace permission for /proc/pid/mem and for actual ptrace_attach.

Comment 10 Daniel Walsh 2010-03-12 20:15:23 UTC
SO this should be dontaudited, since ipsec_mgmt should not be looking as files other then its uid?

Comment 11 Stephen Smalley 2010-03-12 20:23:11 UTC
Yes, I believe so.  Seems to be generated by ps -C pluto in /usr/libexec/ipsec/_realsetup.


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