Bug 789184

Summary: SELinux is preventing /usr/sbin/vpnc from 'write' accesses on the None pkcs11.
Product: [Fedora] Fedora Reporter: sekidde
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, mgrepl, ssekidde, yamato
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:a5695bd7927382857ef37c4be97a7d7c77fe20f9aa183243976f63227e92f236
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-13 18:51:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description sekidde 2012-02-10 03:00:01 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.2.3-2.fc16.x86_64
reason:         SELinux is preventing /usr/sbin/vpnc from 'write' accesses on the None pkcs11.
time:           Thu 09 Feb 2012 09:59:32 PM EST

description:
:SELinux is preventing /usr/sbin/vpnc from 'write' accesses on the None pkcs11.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that vpnc should be allowed write access on the pkcs11 <Unknown> by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep vpnc /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                unconfined_u:unconfined_r:vpnc_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:user_tmp_t:s0
:Target Objects                pkcs11 [ None ]
:Source                        vpnc
:Source Path                   /usr/sbin/vpnc
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           vpnc-0.5.3-13.svn457.fc16.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-75.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.2.3-2.fc16.x86_64 #1
:                              SMP Fri Feb 3 20:08:08 UTC 2012 x86_64 x86_64
:Alert Count                   4
:First Seen                    Fri 03 Feb 2012 11:34:36 PM EST
:Last Seen                     Thu 09 Feb 2012 07:39:56 PM EST
:Local ID                      2c745063-e463-4175-9e3c-23b16f8a71d8
:
:Raw Audit Messages
:type=AVC msg=audit(1328834396.140:119): avc:  denied  { write } for  pid=4052 comm="vpnc" name="pkcs11" dev=dm-2 ino=1967139 scontext=unconfined_u:unconfined_r:vpnc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=sock_filenode=(removed) type=SYSCALL msg=audit(1328834396.140:119): arch=c000003e syscall=42 success=no exit=-13 a0=6 a1=7fff9e796080 a2=6e a3=28 items=0 ppid=3999 pid=4052 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="vpnc" exe="/usr/sbin/vpnc" subj=unconfined_u:unconfined_r:vpnc_t:s0-s0:c0.c1023 key=(null)
:
:
:Hash: vpnc,vpnc_t,user_tmp_t,None,write
:
:audit2allow
:
:
:audit2allow -R
:
:

Comment 1 Miroslav Grepl 2012-02-10 06:50:55 UTC
Is this something new?

Comment 2 Daniel Walsh 2012-02-10 14:14:44 UTC
What tool were you using when this happened?  It looks like vpnc is connecting to some socket named pkcs11 in the /tmp direcory?

Comment 3 Simon Sekidde 2012-02-10 16:35:28 UTC
vpnc via su

[root@localhost ~]# rpm -qa vpnc
vpnc-0.5.3-13.svn457.fc16.x86_64

[root@localhost ~]# vpnc
Enter IPSec gateway address: xxx.xxx.xxx.xxx
Enter IPSec ID for xxx.xxx.xxx.xxx: <Default Group>
Enter IPSec secret for <Default Group>@xxx.xxx.xxx.xxx: 
Enter username for xxx.xxx.xxx.xxx: <my name>
Enter password for <my name>@xxx.xxx.xxx.xxx: 
Connect Banner:

< Banner Contents > 

VPNC started in background (pid: 13444)...


[root@localhost ~]# cat /proc/13444/maps 
7fc3dddf1000-7fc3dde03000 r-xp 00000000 fd:02 3150147                    /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
7fc3dde03000-7fc3de002000 ---p 00012000 fd:02 3150147                    /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
7fc3de002000-7fc3de004000 r--p 00011000 fd:02 3150147                    /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
7fc3de004000-7fc3de005000 rw-p 00013000 fd:02 3150147                    /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
7fc3de005000-7fc3de016000 r-xp 00000000 fd:02 3021129                    /usr/lib64/libp11-kit.so.0.0.0
7fc3de016000-7fc3de215000 ---p 00011000 fd:02 3021129                    /usr/lib64/libp11-kit.so.0.0.0
7fc3de215000-7fc3de216000 r--p 00010000 fd:02 3021129                    /usr/lib64/libp11-kit.so.0.0.0
7fc3de216000-7fc3de217000 rw-p 00011000 fd:02 3021129                    /usr/lib64/libp11-kit.so.0.0.0
7fc3de217000-7fc3de22e000 r-xp 00000000 fd:02 2752591                    /lib64/libpthread-2.14.90.so
7fc3de22e000-7fc3de42d000 ---p 00017000 fd:02 2752591                    /lib64/libpthread-2.14.90.so
7fc3de42d000-7fc3de42e000 r--p 00016000 fd:02 2752591                    /lib64/libpthread-2.14.90.so
7fc3de42e000-7fc3de42f000 rw-p 00017000 fd:02 2752591                    /lib64/libpthread-2.14.90.so
7fc3de42f000-7fc3de433000 rw-p 00000000 00:00 0 
7fc3de433000-7fc3de44a000 r-xp 00000000 fd:02 2752595                    /lib64/libz.so.1.2.5
7fc3de44a000-7fc3de649000 ---p 00017000 fd:02 2752595                    /lib64/libz.so.1.2.5
7fc3de649000-7fc3de64a000 rw-p 00016000 fd:02 2752595                    /lib64/libz.so.1.2.5
7fc3de64a000-7fc3de65a000 r-xp 00000000 fd:02 3034583                    /usr/lib64/libtasn1.so.3.1.9
7fc3de65a000-7fc3de859000 ---p 00010000 fd:02 3034583                    /usr/lib64/libtasn1.so.3.1.9
7fc3de859000-7fc3de85a000 rw-p 0000f000 fd:02 3034583                    /usr/lib64/libtasn1.so.3.1.9
7fc3de85a000-7fc3dea05000 r-xp 00000000 fd:02 2752541                    /lib64/libc-2.14.90.so
7fc3dea05000-7fc3dec05000 ---p 001ab000 fd:02 2752541                    /lib64/libc-2.14.90.so
7fc3dec05000-7fc3dec09000 r--p 001ab000 fd:02 2752541                    /lib64/libc-2.14.90.so
7fc3dec09000-7fc3dec0b000 rw-p 001af000 fd:02 2752541                    /lib64/libc-2.14.90.so
7fc3dec0b000-7fc3dec10000 rw-p 00000000 00:00 0 
7fc3dec10000-7fc3decc1000 r-xp 00000000 fd:02 3017499                    /usr/lib64/libgnutls.so.26.21.8
7fc3decc1000-7fc3deec0000 ---p 000b1000 fd:02 3017499                    /usr/lib64/libgnutls.so.26.21.8
7fc3deec0000-7fc3deec7000 rw-p 000b0000 fd:02 3017499                    /usr/lib64/libgnutls.so.26.21.8
7fc3deec7000-7fc3deec8000 rw-p 00000000 00:00 0 
7fc3deec8000-7fc3deecb000 r-xp 00000000 fd:02 2752634                    /lib64/libgpg-error.so.0.8.0
7fc3deecb000-7fc3df0ca000 ---p 00003000 fd:02 2752634                    /lib64/libgpg-error.so.0.8.0
7fc3df0ca000-7fc3df0cb000 r--p 00002000 fd:02 2752634                    /lib64/libgpg-error.so.0.8.0
7fc3df0cb000-7fc3df0cc000 rw-p 00003000 fd:02 2752634                    /lib64/libgpg-error.so.0.8.0
7fc3df0cc000-7fc3df0ce000 r-xp 00000000 fd:02 2752599                    /lib64/libdl-2.14.90.so
7fc3df0ce000-7fc3df2ce000 ---p 00002000 fd:02 2752599                    /lib64/libdl-2.14.90.so
7fc3df2ce000-7fc3df2cf000 r--p 00002000 fd:02 2752599                    /lib64/libdl-2.14.90.so
7fc3df2cf000-7fc3df2d0000 rw-p 00003000 fd:02 2752599                    /lib64/libdl-2.14.90.so
7fc3df2d0000-7fc3df345000 r-xp 00000000 fd:02 2752635                    /lib64/libgcrypt.so.11.7.0
7fc3df345000-7fc3df545000 ---p 00075000 fd:02 2752635                    /lib64/libgcrypt.so.11.7.0
7fc3df545000-7fc3df546000 r--p 00075000 fd:02 2752635                    /lib64/libgcrypt.so.11.7.0
7fc3df546000-7fc3df549000 rw-p 00076000 fd:02 2752635                    /lib64/libgcrypt.so.11.7.0
7fc3df549000-7fc3df56b000 r-xp 00000000 fd:02 2752535                    /lib64/ld-2.14.90.so
7fc3df74c000-7fc3df752000 rw-p 00000000 00:00 0 
7fc3df763000-7fc3df765000 rw-p 00000000 00:00 0 
7fc3df765000-7fc3df769000 rw-p 00000000 00:00 0 
7fc3df769000-7fc3df76a000 rw-p 00000000 00:00 0 
7fc3df76a000-7fc3df76b000 r--p 00021000 fd:02 2752535                    /lib64/ld-2.14.90.so
7fc3df76b000-7fc3df76c000 rw-p 00022000 fd:02 2752535                    /lib64/ld-2.14.90.so
7fc3df76c000-7fc3df76d000 rw-p 00000000 00:00 0 
7fc3df76d000-7fc3df78e000 r-xp 00000000 fd:02 3021661                    /usr/sbin/vpnc
7fc3df98d000-7fc3df990000 rw-p 00020000 fd:02 3021661                    /usr/sbin/vpnc
7fc3df990000-7fc3df994000 rw-p 00000000 00:00 0 
7fc3e10b3000-7fc3e10d4000 rw-p 00000000 00:00 0                          [heap]
7fff16e05000-7fff16e26000 rw-p 00000000 00:00 0                          [stack]
7fff16fcf000-7fff16fd0000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]


[root@localhost ~]# cat /var/log/audit.log | audit2why 
...
type=AVC msg=audit(1328890654.157:298): avc:  denied  { write } for  pid=13160 comm="vpnc" name="pkcs11" dev=dm-2 ino=1967293 scontext=unconfined_u:unconfined_r:vpnc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=sock_file

	Was caused by:
		Missing type enforcement (TE) allow rule.

		You can use audit2allow to generate a loadable module to allow this access.

[root@localhost ~]# cat /var/log/audit.log | audit2allow -alR 

require {
	type vpnc_t;
}

#============= vpnc_t ==============
userdom_write_user_tmp_sockets(vpnc_t)

Comment 4 Daniel Walsh 2012-02-14 20:36:45 UTC
So vpnc somehow knows how to write to the gnome-keyring socket, or this is a leaked file descriptor.

Although this syscall is a connect, so I guess we should allow it.  Maybe it would use a key from the keyring to connect?

Comment 5 Fedora End Of Life 2013-01-16 15:43:08 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Fedora End Of Life 2013-02-13 18:51:28 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.