Bug 1066093 - SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /proc/<pid>/environ.
Summary: SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /proc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:566ae5d91190ef234a5f5430c76...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-17 16:38 UTC by Peter Schiffer
Modified: 2014-03-12 12:19 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.12.1-127.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-12 12:19:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Peter Schiffer 2014-02-17 16:38:42 UTC
Description of problem:
OpenLMI HW provider is now using virt-what program to determine virtual environment.
SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /proc/<pid>/environ.

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

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

Additional Information:
Source Context                system_u:system_r:pegasus_openlmi_storage_t:s0
Target Context                system_u:system_r:init_t:s0
Target Objects                /proc/<pid>/environ [ file ]
Source                        virt-what
Source Path                   /usr/bin/bash
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bash-4.2.45-4.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-124.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.12.10-300.fc20.x86_64 #1 SMP Thu
                              Feb 6 22:11:48 UTC 2014 x86_64 x86_64
Alert Count                   12
First Seen                    2014-02-12 13:43:35 CET
Last Seen                     2014-02-17 17:35:56 CET
Local ID                      767c325c-8ce5-416b-babc-0cee693eb9c9

Raw Audit Messages
type=AVC msg=audit(1392654956.754:943): avc:  denied  { getattr } for  pid=19174 comm="virt-what" path="/proc/1/environ" dev="proc" ino=1130 scontext=system_u:system_r:pegasus_openlmi_storage_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file


type=SYSCALL msg=audit(1392654956.754:943): arch=x86_64 syscall=stat success=yes exit=0 a0=1bf8130 a1=7fffcfc91280 a2=7fffcfc91280 a3=8 items=0 ppid=18976 pid=19174 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=virt-what exe=/usr/bin/bash subj=system_u:system_r:pegasus_openlmi_storage_t:s0 key=(null)

Hash: virt-what,pegasus_openlmi_storage_t,init_t,file,getattr

Additional info:
reporter:       libreport-2.1.12
hashmarkername: setroubleshoot
kernel:         3.12.10-300.fc20.x86_64
type:           libreport

Comment 1 Peter Schiffer 2014-02-17 16:40:55 UTC
Here's the second selinux report because of the same problem:

SELinux is preventing /usr/bin/cat from read access on the file environ.

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

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

Additional Information:
Source Context                system_u:system_r:pegasus_openlmi_storage_t:s0
Target Context                system_u:system_r:init_t:s0
Target Objects                environ [ file ]
Source                        cat
Source Path                   /usr/bin/cat
Port                          <Unknown>
Host                          work-ntb
Source RPM Packages           coreutils-8.21-20.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-124.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     work-ntb
Platform                      Linux work-ntb 3.12.10-300.fc20.x86_64 #1 SMP Thu
                              Feb 6 22:11:48 UTC 2014 x86_64 x86_64
Alert Count                   12
First Seen                    2014-02-12 13:43:35 CET
Last Seen                     2014-02-17 17:35:56 CET
Local ID                      e68ace0e-3d70-4c22-93c2-f00e8d691951

Raw Audit Messages
type=AVC msg=audit(1392654956.755:944): avc:  denied  { read } for  pid=19186 comm="cat" name="environ" dev="proc" ino=1130 scontext=system_u:system_r:pegasus_openlmi_storage_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file


type=AVC msg=audit(1392654956.755:944): avc:  denied  { open } for  pid=19186 comm="cat" path="/proc/1/environ" dev="proc" ino=1130 scontext=system_u:system_r:pegasus_openlmi_storage_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file


type=SYSCALL msg=audit(1392654956.755:944): arch=x86_64 syscall=open success=yes exit=ENXIO a0=7fff2bbb3ee5 a1=0 a2=1fffffffffff0000 a3=347de85ad0 items=0 ppid=19174 pid=19186 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=cat exe=/usr/bin/cat subj=system_u:system_r:pegasus_openlmi_storage_t:s0 key=(null)

Hash: cat,pegasus_openlmi_storage_t,init_t,file,read

Comment 2 Miroslav Grepl 2014-02-18 13:14:51 UTC
commit 6b327d37f526962fd2ca018ea8d5d73ef51d7ffe
Author: Miroslav Grepl <mgrepl>
Date:   Tue Feb 18 14:14:38 2014 +0100

    Allow pegasus_openlmi_storage_t to read /proc/1/environ

Comment 3 Fedora Update System 2014-02-18 22:10:39 UTC
selinux-policy-3.12.1-126.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-126.fc20

Comment 4 Fedora Update System 2014-02-22 00:42:50 UTC
Package selinux-policy-3.12.1-126.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-126.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2801/selinux-policy-3.12.1-126.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-02-26 13:51:06 UTC
Package selinux-policy-3.12.1-127.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-127.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2801/selinux-policy-3.12.1-127.fc20
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-03-12 12:19:47 UTC
selinux-policy-3.12.1-127.fc20 has been pushed to the Fedora 20 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.