Bug 664684

Summary: init_write_script_pipes(load_policy_t)
Product: Red Hat Enterprise Linux 5 Reporter: Jan Sarenik <jsarenik>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: low    
Version: 5.7CC: dwalsh, mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-2.4.6-301.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 09:21:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Sarenik 2010-12-21 10:18:15 UTC
Condor package out of MRG product contains following line
in its RPM postinstall scriptlet:

  semanage fcontext -a -t unconfined_execmem_exec_t /usr/sbin/condor_startd

After installing it, I can find AVCs like following one:

  type=AVC msg=audit(1292597868.670:22): avc:  denied  { write } for  pid=4743 comm="load_policy" path="pipe:[16421]" dev=pipefs 

condor-7.4.5-0.3.el5
selinux-policy-2.4.6-279.el5_5.2
selinux-policy-targeted-2.4.6-279.el5_5.2

How reproducible: 100%

Steps to Reproduce:
1. Install condor package on RHEL5
2. Run
/usr/bin/env LC_ALL=en_US.UTF-8 /sbin/ausearch -m AVC -m USER_AVC -m SELINUX_ERR
  
Actual results: denied AVC found
Expected results: no deny

Comment 1 Jan Sarenik 2010-12-21 11:37:03 UTC
Hmm, the package have to be installed from
tcontext=user_u:system_r:rpm_script_t:s0 context (not as normal logged-in
root) for the AVCs to appear.

That's the way how scripts are run in Beaker.

Comment 2 Daniel Walsh 2010-12-21 14:06:06 UTC
Please attach the entire AVC message.

Comment 4 Jan Sarenik 2010-12-21 14:10:36 UTC
time->Fri Dec 17 09:57:48 2010
type=SYSCALL msg=audit(1292597868.670:22): arch=40000003 syscall=11 success=yes exit=0 a0=94b1f18 a1=af28060 a2=0 a3=0 items=0 ppid=4694 pid=4743 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="load_policy" exe="/usr/sbin/load_policy" subj=system_u:system_r:load_policy_t:s0 key=(null)
type=AVC msg=audit(1292597868.670:22): avc:  denied  { write } for  pid=4743 comm="load_policy" path="pipe:[16421]" dev=pipefs ino=16421 scontext=system_u:system_r:load_policy_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=fifo_file
type=AVC msg=audit(1292597868.670:22): avc:  denied  { write } for  pid=4743 comm="load_policy" path="pipe:[16421]" dev=pipefs

Comment 5 Miroslav Grepl 2011-03-01 17:10:17 UTC
Fixed in selinux-policy-2.4.6-301.el5

Comment 8 errata-xmlrpc 2011-07-21 09:21:32 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1069.html

Comment 9 errata-xmlrpc 2011-07-21 11:50:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1069.html