Bug 580516 - SELinux is preventing /sbin/setfiles access to a leaked /dev/ptmx file descriptor.
Summary: SELinux is preventing /sbin/setfiles access to a leaked /dev/ptmx file descri...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: mrxvt
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Tomáš Bžatek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:e4bb144dbc3...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-08 13:13 UTC by Eric Rannaud
Modified: 2015-03-03 22:46 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-03 16:10:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Eric Rannaud 2010-04-08 13:13:02 UTC
Summary:

SELinux is preventing /sbin/setfiles access to a leaked /dev/ptmx file
descriptor.

Detailed Description:

[restorecon has a permissive type (setfiles_t). This access was not denied.]

SELinux denied access requested by the restorecon command. It looks like this is
either a leaked descriptor or restorecon output was redirected to a file it is
not allowed to access. Leaks usually can be ignored since SELinux is just
closing the leak and reporting the error. The application does not use the
descriptor, so it will run properly. If this is a redirection, you will not get
output in the /dev/ptmx. You should generate a bugzilla on selinux-policy, and
it will get routed to the appropriate package. You can safely ignore this avc.

Allowing Access:

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

Additional Information:

Source Context                unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c102
                              3
Target Context                system_u:object_r:ptmx_t:s0
Target Objects                /dev/ptmx [ chr_file ]
Source                        restorecon
Source Path                   /sbin/setfiles
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           policycoreutils-2.0.79-1.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-106.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   leaks
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                   391
First Seen                    Wed 24 Mar 2010 02:31:00 PM PDT
Last Seen                     Thu 08 Apr 2010 06:12:05 AM PDT
Local ID                      59c91c5f-31f6-4a0f-b9b6-f35cca0278de
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1270732325.770:2159): avc:  denied  { read write } for  pid=13869 comm="restorecon" path="/dev/ptmx" dev=devtmpfs ino=5073 scontext=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file

node=(removed) type=SYSCALL msg=audit(1270732325.770:2159): arch=c000003e syscall=59 success=yes exit=0 a0=280d0d0 a1=2835240 a2=27a88e0 a3=18 items=0 ppid=13272 pid=13869 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=pts11 ses=20 comm="restorecon" exe="/sbin/setfiles" subj=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  leaks,restorecon,setfiles_t,ptmx_t,chr_file,read,write
audit2allow suggests:

#============= setfiles_t ==============
allow setfiles_t ptmx_t:chr_file { read write };

Comment 1 Daniel Walsh 2010-04-08 13:26:14 UTC
What application were you running when this happened?  libvirt?

Comment 2 Eric Rannaud 2010-04-08 17:18:32 UTC
No, I was simply running restorecon from the command line on a file from a 3rd party application that had a usr_t context instead of lib_t (the 3rd party app installer is not selinux aware, and ended-up with incorrect contexts).

Comment 3 Daniel Walsh 2010-04-08 19:32:45 UTC
In that case it looks like the terminal shell you are using is leaking the /dev/ptmx.

Comment 4 Eric Rannaud 2010-04-09 00:42:14 UTC
OK. So I set mrxvt as the component with the bug.

Comment 5 Daniel Walsh 2010-04-09 11:18:35 UTC
All open file descriptors and sockets should be closed on exec.

fcntl(fd, F_SETFD, FD_CLOEXEC)

Comment 6 Bug Zapper 2010-11-03 17:35:08 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  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 WONTFIX if it remains open with a Fedora 
'version' of '12'.

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 prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2010-12-03 16:10:08 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 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.

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.