Bug 595977 - SELinux is preventing unix_chkpwd "getattr" access on /usr/sbin/prelink.
SELinux is preventing unix_chkpwd "getattr" access on /usr/sbin/prelink.
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
13
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
setroubleshoot_trace_hash:0357a34ab27...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-25 23:20 EDT by Joel Kirchmeyer
Modified: 2013-01-10 03:08 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-02-22 12:30:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joel Kirchmeyer 2010-05-25 23:20:01 EDT
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 16:00:24 EDT
Why would unix_chkpwd be looking at the prelink executable?
Comment 2 Jiri Kastner 2010-06-17 03:14:58 EDT
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 09:15:37 EDT
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 10:43:51 EDT
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 10:57:33 EDT
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 11:30:29 EDT
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 11:32:55 EDT
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 16:48:31 EST
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 16:50:03 EST
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 16:51:18 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

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