Bug 628551 - Selinux denial during ks distro creation
Summary: Selinux denial during ks distro creation
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.1
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Petr Sklenar
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space13
TreeView+ depends on / blocked
 
Reported: 2010-08-30 11:24 UTC by Petr Sklenar
Modified: 2011-02-08 08:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-08 08:41:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Petr Sklenar 2010-08-30 11:24:07 UTC
Description of problem:
There is selinux denial during ks distro creation.

Version-Release number of selected component (if applicable):
$ rpm -qa | grep selinux
oracle-instantclient-selinux-10.2-18.fc13.noarch
selinux-policy-targeted-3.7.19-49.fc13.noarch
osa-dispatcher-selinux-5.9.38-1.fc13.noarch
libselinux-utils-2.0.90-5.fc13.x86_64
spacewalk-selinux-1.1.1-1.fc13.noarch
oracle-nofcontext-selinux-0.1-23.17.fc13.noarch
oracle-xe-selinux-10.2-17.fc13.noarch
libselinux-devel-2.0.90-5.fc13.x86_64
libselinux-python-2.0.90-5.fc13.x86_64
spacewalk-monitoring-selinux-1.1.1-1.fc13.noarch
selinux-policy-3.7.19-49.fc13.noarch
libselinux-2.0.90-5.fc13.x86_64
oracle-instantclient-sqlplus-selinux-10.2-18.fc13.noarch

$ rpm -q cobbler
cobbler-2.0.3.1-4.fc13.noarch

How reproducible:
always

Steps to Reproduce:
1. prepare some folder /test with
/tmp/test
`-- images
    `-- pxeboot
        |-- initrd.img
        `-- vmlinuz
2. webUI: create your own distro
3. failure: 'The kernel could not be found at the specified location'
  
Actual results:

type=AVC msg=audit(1283167084.527:34268): avc:  denied  { link } for  pid=2762 comm="cobblerd" name="vmlinuz" dev=dm-0 ino=2626150 scontext=system_u:system_r:cobblerd_t:s0 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file
type=AVC msg=audit(1283167084.528:34269): avc:  denied  { write } for  pid=2762 comm="cobblerd" name="images" dev=dm-0 ino=1056234 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:public_content_rw_t:s0 tclass=dir
type=AVC msg=audit(1283167084.528:34269): avc:  denied  { add_name } for  pid=2762 comm="cobblerd" name="ks-bug493176-228e:1:SpacewalkDefaultOrganization" scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:public_content_rw_t:s0 tclass=dir
type=AVC msg=audit(1283167084.528:34269): avc:  denied  { create } for  pid=2762 comm="cobblerd" name="ks-bug493176-228e:1:SpacewalkDefaultOrganization" scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:public_content_rw_t:s0 tclass=dir

Expected results:
no selinux denial

Additional info:

Comment 2 Jan Pazdziora 2010-11-19 16:05:41 UTC
Mass-moving to space13.

Comment 3 Petr Sklenar 2010-11-24 09:58:51 UTC
FYI
this bug is still present on sw12 installed on F13:

type=AVC msg=audit(1290595671.434:46358): avc:  denied  { write } for  pid=26481 comm="cobblerd" name="cobbler" dev=dm-0 ino=270738 scontext=unconfined_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=AVC msg=audit(1290595671.434:46358): avc:  denied  { add_name } for  pid=26481 comm="cobblerd" name="rendered" scontext=unconfined_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=AVC msg=audit(1290595671.434:46358): avc:  denied  { create } for  pid=26481 comm="cobblerd" name="rendered" scontext=unconfined_u:system_r:cobblerd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=AVC msg=audit(1290595671.439:46359): avc:  denied  { link } for  pid=26481 comm="cobblerd" name="vmlinuz" dev=dm-0 ino=794835 scontext=unconfined_u:system_r:cobblerd_t:s0 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file
--
location of distro is in tmp directory
--
I want to point out that this works well on rhel5 but not on F13

Comment 4 Jan Pazdziora 2010-12-23 12:13:23 UTC
The real fix is to chcon the /test to cobbler_tmp_t or some similar type which cobbler can read.

The problem only appears on Fedora because on RHEL 5, cobblerd is running unconfined.

Comment 7 Tomas Lestach 2011-02-08 08:41:36 UTC
This bug has been fixed in Spacewalk 1.3.


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