Bug 989701

Summary: SELinux is preventing /usr/libexec/gnupg-pcsc-wrapper from 'write' accesses on the sock_file pcscd.comm.
Product: [Fedora] Fedora Reporter: Garrett Holmstrom <gholms>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:76f819aad930e3b9d4fbac15657996726a0c08f14bc4c7ab89c0c34ff3a92aac
Fixed In Version: selinux-policy-3.11.1-100.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-15 02:54:45 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 Garrett Holmstrom 2013-07-29 18:20:18 UTC
Description of problem:
This popped up while I was using gnupg2 and friends to program a USB PGP token.
SELinux is preventing /usr/libexec/gnupg-pcsc-wrapper from 'write' accesses on the sock_file pcscd.comm.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that gnupg-pcsc-wrapper should be allowed write access on the pcscd.comm sock_file 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 gnupg-pcsc-wrap /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                staff_u:staff_r:gpg_agent_t:s0-s0:c0.c1023
Target Context                system_u:object_r:pcscd_var_run_t:s0
Target Objects                pcscd.comm [ sock_file ]
Source                        gnupg-pcsc-wrap
Source Path                   /usr/libexec/gnupg-pcsc-wrapper
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           gnupg2-2.0.19-7.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.9.6-200.fc18.x86_64 #1 SMP Thu
                              Jun 13 18:56:55 UTC 2013 x86_64 x86_64
Alert Count                   7
First Seen                    2013-07-23 18:06:44 PDT
Last Seen                     2013-07-23 19:28:38 PDT
Local ID                      db418b96-6b81-4829-9fa5-bdcf05df4a73

Raw Audit Messages
type=AVC msg=audit(1374632918.71:4678): avc:  denied  { write } for  pid=25457 comm="gnupg-pcsc-wrap" name="pcscd.comm" dev="tmpfs" ino=16233 scontext=staff_u:staff_r:gpg_agent_t:s0-s0:c0.c1023 tcontext=system_u:object_r:pcscd_var_run_t:s0 tclass=sock_file


type=AVC msg=audit(1374632918.71:4678): avc:  denied  { connectto } for  pid=25457 comm="gnupg-pcsc-wrap" path="/run/pcscd/pcscd.comm" scontext=staff_u:staff_r:gpg_agent_t:s0-s0:c0.c1023 tcontext=system_u:system_r:pcscd_t:s0 tclass=unix_stream_socket


type=SYSCALL msg=audit(1374632918.71:4678): arch=x86_64 syscall=connect success=yes exit=0 a0=3 a1=7fffeb795260 a2=1c a3=7fffeb794fe0 items=0 ppid=1 pid=25457 auid=1000 uid=1000 gid=100 euid=1000 suid=1000 fsuid=1000 egid=100 sgid=100 fsgid=100 ses=2 tty=(none) comm=gnupg-pcsc-wrap exe=/usr/libexec/gnupg-pcsc-wrapper subj=staff_u:staff_r:gpg_agent_t:s0-s0:c0.c1023 key=(null)

Hash: gnupg-pcsc-wrap,gpg_agent_t,pcscd_var_run_t,sock_file,write

audit2allow

#============= gpg_agent_t ==============
allow gpg_agent_t pcscd_t:unix_stream_socket connectto;
allow gpg_agent_t pcscd_var_run_t:sock_file write;

audit2allow -R
require {
	type gpg_agent_t;
}

#============= gpg_agent_t ==============
pcscd_stream_connect(gpg_agent_t)


Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.11-200.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-07-29 19:02:21 UTC
4650022612c52918ac8ad9910ee153894d029d08 allows this in git.

Comment 2 Fedora Update System 2013-08-05 05:41:35 UTC
selinux-policy-3.11.1-99.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-99.fc18

Comment 3 Fedora Update System 2013-08-06 00:15:12 UTC
Package selinux-policy-3.11.1-99.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-99.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-14256/selinux-policy-3.11.1-99.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-08-07 11:13:21 UTC
selinux-policy-3.11.1-100.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-100.fc18

Comment 5 Fedora Update System 2013-08-15 02:54:45 UTC
selinux-policy-3.11.1-100.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.