Bug 1043210 - SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the file /var/lib/tftpboot/undionly.kpxe.
Summary: SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the file /v...
Keywords:
Status: CLOSED EOL
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:facd8d1897cecbedf452ee9b1fc...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-15 00:12 UTC by Cole Robinson
Modified: 2015-06-29 13:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 13:31:40 UTC
Type: ---


Attachments (Terms of Use)

Description Cole Robinson 2013-12-15 00:12:34 UTC
Description of problem:
Triggered by cobbler sync. That undionly.kpxe isn't owned by any package, cobbler seems to be trying to create it?
SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the file /var/lib/tftpboot/undionly.kpxe.

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

If you believe that python2.7 should be allowed write access on the undionly.kpxe 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 cobblerd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:cobblerd_t:s0
Target Context                system_u:object_r:tftpdir_rw_t:s0
Target Objects                /var/lib/tftpboot/undionly.kpxe [ file ]
Source                        cobblerd
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.5-9.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-106.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.11.10-301.fc20.x86_64 #1 SMP Thu
                              Dec 5 09:36:10 EST 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-12-14 19:08:25 EST
Last Seen                     2013-12-14 19:08:25 EST
Local ID                      716ce883-4414-4d3a-b27f-b1a735e2442f

Raw Audit Messages
type=AVC msg=audit(1387066105.492:810): avc:  denied  { write } for  pid=4623 comm="cobblerd" name="undionly.kpxe" dev="sda2" ino=7606471 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:tftpdir_rw_t:s0 tclass=file


type=AVC msg=audit(1387066105.492:810): avc:  denied  { open } for  pid=4623 comm="cobblerd" path="/var/lib/tftpboot/undionly.kpxe" dev="sda2" ino=7606471 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:tftpdir_rw_t:s0 tclass=file


type=SYSCALL msg=audit(1387066105.492:810): arch=x86_64 syscall=open success=yes exit=EROFS a0=7f27ec001220 a1=241 a2=1b6 a3=1 items=0 ppid=1 pid=4623 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=cobblerd exe=/usr/bin/python2.7 subj=system_u:system_r:cobblerd_t:s0 key=(null)

Hash: cobblerd,cobblerd_t,tftpdir_rw_t,file,write

Additional info:
reporter:       libreport-2.1.9
hashmarkername: setroubleshoot
kernel:         3.11.10-301.fc20.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-12-16 10:20:40 UTC
Dominick,
should we handle it by a filename rule?

Comment 2 Daniel Walsh 2013-12-16 15:47:32 UTC
Miroslav is this the only file you want to allow cobblerd to write there?

Are you suggesting we generate another type?

Comment 3 Cole Robinson 2013-12-16 16:01:19 UTC
Cobbler already writes other files to /var/lib/tftpboot: menu.c32, pxelinux.0, etc. So maybe some existing rule just needs to be extended?

Comment 4 Miroslav Grepl 2014-01-07 14:35:28 UTC
(In reply to Daniel Walsh from comment #2)
> Miroslav is this the only file you want to allow cobblerd to write there?
> 
> Are you suggesting we generate another type?

Yes. But it looks there is more files how Cole wrote.

Cole, 
any chance to write a list of these files?

Comment 5 Cole Robinson 2014-01-11 18:24:10 UTC
(In reply to Miroslav Grepl from comment #4)
> (In reply to Daniel Walsh from comment #2)
> > Miroslav is this the only file you want to allow cobblerd to write there?
> > 
> > Are you suggesting we generate another type?
> 
> Yes. But it looks there is more files how Cole wrote.
> 
> Cole, 
> any chance to write a list of these files?

Well, those other files that cobbler writes don't generate any AVCs that I've seen, so I thought there was an existing cobbler rule or something. The reported AVC is the only one I saw, but maybe this helps:

$ ls -l /var/lib/tftpboot/
total 368
drwxr-xr-x.  2 root root   4096 Oct 25  2011 etc
drwxr-xr-x.  2 root root   4096 Dec 14 19:08 grub
drwxr-xr-x. 11 root root   4096 Dec 14 19:08 images
-rw-r--r--.  1 root root  26140 Dec 14 19:08 memdisk
-rw-r--r--.  1 root root  39188 Dec 14 19:08 menu.c32
drwxr-xr-x.  2 root root   4096 Oct 25  2011 ppc
-rw-r--r--.  1 root root  14716 Dec 14 19:08 pxelinux.0
drwxr-xr-x.  2 root root   4096 Dec 14 19:08 pxelinux.cfg
drwxr-xr-x.  2 root root   4096 Dec 14 19:08 s390x
-rw-r--r--.  1 root root  65128 Dec 14 19:08 undionly.kpxe
-rw-r--r--.  1 root root 198192 Dec 14 19:08 yaboot

Comment 6 Fedora End Of Life 2015-05-29 09:59:41 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 EOL if it remains open with a Fedora  'version'
of '20'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 7 Fedora End Of Life 2015-06-29 13:31:40 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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.