Bug 854671 - selinux avcs when running openswan on a system with fips enabled
selinux avcs when running openswan on a system with fips enabled
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.2
All Linux
high Severity high
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-05 10:05 EDT by Avesh Agarwal
Modified: 2013-02-21 03:28 EST (History)
6 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-168.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:28:39 EST
Type: Bug
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 Avesh Agarwal 2012-09-05 10:05:25 EDT
Description of problem:
When running openswan daemon pluto on a rhel6.2 system with fips enabled, I notice following avcs:

time->Tue Sep  4 14:58:59 2012
type=SYSCALL msg=audit(1346785139.015:23478): arch=c000003e syscall=4
success=yes exit=0 a0=7f84b60d35d0 a1=7fff9fd48200 a2=7fff9fd48200 a3=1a
items=0 ppid=10062 pid=10066 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0
egid=0 sgid=0 fsgid=0 tty=pts0 ses=1245 comm="pluto"
exe="/usr/libexec/ipsec/pluto" subj=unconfined_u:system_r:ipsec_t:s0
key=(null)
type=AVC msg=audit(1346785139.015:23478): avc:  denied  { getattr } for 
pid=10066 comm="pluto" path="/usr/sbin/prelink" dev=dm-0 ino=1189939
scontext=unconfined_u:system_r:ipsec_t:s0
tcontext=system_u:object_r:prelink_exec_t:s0 tclass=file
----
time->Tue Sep  4 14:58:59 2012
type=SYSCALL msg=audit(1346785139.015:23479): arch=c000003e syscall=59
success=yes exit=0 a0=7f84b60d35d0 a1=7f84b60d3600 a2=7fff9fd491d0
a3=7fff9fd47f50 items=0 ppid=10066 pid=10069 auid=0 uid=0 gid=0 euid=0
suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1245 comm="prelink"
exe="/usr/sbin/prelink" subj=unconfined_u:system_r:ipsec_t:s0 key=(null)
type=AVC msg=audit(1346785139.015:23479): avc:  denied  {
execute_no_trans } for  pid=10069 comm="pluto" path="/usr/sbin/prelink"
dev=dm-0 ino=1189939 scontext=unconfined_u:system_r:ipsec_t:s0
tcontext=system_u:object_r:prelink_exec_t:s0 tclass=file
type=AVC msg=audit(1346785139.015:23479): avc:  denied  { read open }
for  pid=10069 comm="pluto" name="prelink" dev=dm-0 ino=1189939
scontext=unconfined_u:system_r:ipsec_t:s0
tcontext=system_u:object_r:prelink_exec_t:s0 tclass=file
type=AVC msg=audit(1346785139.015:23479): avc:  denied  { execute } for 
pid=10069 comm="pluto" name="prelink" dev=dm-0 ino=1189939
scontext=unconfined_u:system_r:ipsec_t:s0
tcontext=system_u:object_r:prelink_exec_t:s0 tclass=file
----
time->Tue Sep  4 14:58:59 2012
type=SYSCALL msg=audit(1346785139.015:23480): arch=c000003e syscall=1
success=yes exit=162776 a0=1 a1=7f82d44bf000 a2=27bd8 a3=2 items=0
ppid=10066 pid=10069 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0
sgid=0 fsgid=0 tty=pts0 ses=1245 comm="prelink" exe="/usr/sbin/prelink"
subj=unconfined_u:system_r:ipsec_t:s0 key=(null)
type=AVC msg=audit(1346785139.015:23480): avc:  denied  { write } for 
pid=10069 comm="prelink" path="pipe:[251277]" dev=pipefs ino=251277
scontext=unconfined_u:system_r:ipsec_t:s0
tcontext=unconfined_u:system_r:ipsec_t:s0 tclass=fifo_file
----
time->Tue Sep  4 14:58:59 2012
type=SYSCALL msg=audit(1346785139.017:23481): arch=c000003e syscall=93
success=yes exit=0 a0=1 a1=0 a2=0 a3=2 items=0 ppid=10066 pid=10069
auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0
ses=1245 comm="prelink" exe="/usr/sbin/prelink"
subj=unconfined_u:system_r:ipsec_t:s0 key=(null)
type=AVC msg=audit(1346785139.017:23481): avc:  denied  { setattr } for 
pid=10069 comm="prelink" name="" dev=pipefs ino=251277
scontext=unconfined_u:system_r:ipsec_t:s0
tcontext=unconfined_u:system_r:ipsec_t:s0 tclass=fifo_file

Version-Release number of selected component (if applicable):
kernel-2.6.32-220.4.2.el6.x86_64
selinux-policy-3.7.19-126.el6.noarch

How reproducible:
Always.

Steps to Reproduce:
1. Boot a rhel6.2 system in fips mode.
2. Run openswan service: "service ipsec start"
3. Run ausearch -m avc
  
Actual results:
There are avcs on the systems.

Expected results:
There should not be any avcs.

Additional info:
Comment 2 Milos Malik 2012-09-07 10:01:05 EDT
I believe that prelink should not occur on FIPS machines.
Comment 3 Miroslav Grepl 2012-09-11 03:02:35 EDT
Yes. You should uninstall the prelink on FIPS machines.
Comment 4 Steve Grubb 2012-09-11 07:05:17 EDT
Is SE Linux FIPS-140 aware? Should it know whether or not FIPS-140 is enabled and therefore block prelink? Otherwise, on a non-FIPS machine, you will get this.
Comment 5 Paul Wouters 2012-09-18 14:59:02 EDT
IMHO, at bootup when in fips mode, prelinking should be undone and the daily cron job extended to skip prelinking when in fips mode. Also, removing the prelink package should first run prelink -ua. (see related bugs)
Comment 14 Daniel Walsh 2012-09-19 20:21:53 EDT
So pluto and unix_chkpwd run or stat prelink when in fips_mode?  Is this real? Something caused by glibc?  Do I need to allow all domains to stat prelink?
Comment 15 Avesh Agarwal 2012-09-20 08:46:43 EDT
(In reply to comment #14)
> So pluto and unix_chkpwd run or stat prelink when in fips_mode?  Is this
> real? Something caused by glibc?  Do I need to allow all domains to stat
> prelink?

pluto does not touch prelink directly. pluto calls NSS API to initialize NSS database and that in turns stat prelink when NSS DB is in fips mode (irrespective of status of /proc/sys/crypto/fips_enabled). The bug https://bugzilla.redhat.com/show_bug.cgi?id=796423 seems to be have the same issue so it might be helpful.

I am not sure about what unix_chkpwd does with prelink. I noticed it when system is in fips mode (/proc/sys/crypto/fips_enabled set to 1) and I logged in using ssh.
Comment 16 Steve Grubb 2012-09-20 08:53:40 EDT
unix_chkpwd calls crypt in glibc. Glibc uses nss for crypto. So, its the same root cause. My guess is nss doesn't really need to be checking prelink. But the software is already shipped so we have to deal with it.
Comment 17 Daniel Walsh 2012-09-26 17:13:38 EDT
I have no problem allowing all domains to getattr on prelink_exec_t, if this is built into glibc.
Comment 18 Miroslav Grepl 2012-10-09 08:16:53 EDT
I added it.
Comment 22 errata-xmlrpc 2013-02-21 03:28:39 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0314.html

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