Bug 595977

Summary: SELinux is preventing unix_chkpwd "getattr" access on /usr/sbin/prelink.
Product: [Fedora] Fedora Reporter: Joel Kirchmeyer <kirchmeyer>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: cz172638, dwalsh, eparis, jakub, jfeeney, jmorris, mgrepl, sdsmall, sgrubb, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:0357a34ab2753c82bc3d35df8554b735fbfaaea625dcb8453dc133ba3c8f5e68
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-22 17:30:35 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 Joel Kirchmeyer 2010-05-26 03:20:01 UTC
Summary:

SELinux is preventing unix_chkpwd "getattr" access on /usr/sbin/prelink.

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux denied access requested by unix_chkpwd. It is not expected that this
access is required by unix_chkpwd and this access may signal an intrusion
attempt. It is also possible that the specific version or configuration of the
application is causing it to require additional access.

Allowing Access:

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

Additional Information:

Source Context                unconfined_u:unconfined_r:chkpwd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:prelink_exec_t:s0
Target Objects                /usr/sbin/prelink [ file ]
Source                        unix_chkpwd
Source Path                   unix_chkpwd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           prelink-0.4.3-3.fc13
Policy RPM                    selinux-policy-3.7.19-15.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed) 2.6.34-git10 #1 SMP
                              PREEMPT Tue May 25 22:58:58 EDT 2010 x86_64 x86_64
Alert Count                   3
First Seen                    Tue 25 May 2010 11:12:00 PM EDT
Last Seen                     Tue 25 May 2010 11:19:17 PM EDT
Local ID                      7208f5df-42d3-455e-b4ae-1cad627b4827
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1274843957.660:33): avc:  denied  { getattr } for  pid=6448 comm="unix_chkpwd" path="/usr/sbin/prelink" dev=dm-0 ino=199675 scontext=unconfined_u:unconfined_r:chkpwd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:prelink_exec_t:s0 tclass=file



Hash String generated from  catchall,unix_chkpwd,chkpwd_t,prelink_exec_t,file,getattr
audit2allow suggests:

#============= chkpwd_t ==============
allow chkpwd_t prelink_exec_t:file getattr;

Comment 1 Daniel Walsh 2010-05-26 20:00:24 UTC
Why would unix_chkpwd be looking at the prelink executable?

Comment 2 Jiri Kastner 2010-06-17 07:14:58 UTC
i registered this error in fips mode, when packagekit asked me for root password. when password entered, auth. was successfull, operation performed despite of selinux denial.

Comment 3 Jakub Jelinek 2010-06-17 13:15:37 UTC
In fips mode the crypto libraries do during startup a mandated self-test against accidentail corruption of itself.  It uses prelink -o - -u library
to output the unprelinked library's content to stdout (which is then checksummed or whatever the library wants to do with it).

Comment 4 Daniel Walsh 2010-06-18 14:43:51 UTC
Well SELinux is not going to get along with this...  

Does this mean every login app and potentially evey app needs to run prelink?

I wonder if prelink_exec is enough, since it is not modifying the content on disk.

Comment 5 Jakub Jelinek 2010-06-18 14:57:33 UTC
Well, not just every login app, in FIPS mode any app that loads in the crypto libs (libfreebl3.so).
Sure, prelink in that mode doesn't need very special priviledges, all it needs is to be able to read the library, write a temporary file in /tmp/ (O_RDWR|O_CREAT|O_EXCL) and that's about it.  You can strace it to see what it does.

Comment 6 Daniel Walsh 2010-06-18 15:30:29 UTC
This means I need new prelink domain prelink_fips_t, and prelink_fips_tmp_t 

if fips_mode {
prelink_domtrans_fips(domain)
}

Then allow the prelink_fips_t to write to prelink_fips_tmp_t.

But I am not sure how we handle prelink_domtrans separately.

Comment 7 Daniel Walsh 2010-06-18 15:32:55 UTC
I guess I could add a attribute to all domains that call

prelink_domtrans prelink_domain

and then have policy that says

if fips_mode {
prelink_domtrans_fips(domain -prelink_domain)
}

Comment 8 Fedora Admin XMLRPC Client 2010-11-08 21:48:31 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Fedora Admin XMLRPC Client 2010-11-08 21:50:03 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 Fedora Admin XMLRPC Client 2010-11-08 21:51:18 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.