RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 604086 - SELinux is preventing /usr/libexec/gdm-smartcard-worker "create" access on coolkeypk11sGeneric CCID Reader 00 00-42.
Summary: SELinux is preventing /usr/libexec/gdm-smartcard-worker "create" access ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pam_pkcs11
Version: 6.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Bob Relyea
QA Contact: Radek Bíba
URL:
Whiteboard: setroubleshoot_trace_hash:54cb172e50b...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-15 11:53 UTC by Radek Bíba
Modified: 2010-11-11 16:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-11 16:21:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Radek Bíba 2010-06-15 11:53:40 UTC
Summary:

SELinux is preventing /usr/libexec/gdm-smartcard-worker "create" access on
coolkeypk11sGeneric CCID Reader 00 00-42.

Detailed Description:

SELinux denied access requested by gdm-smartcard-w. It is not expected that this
access is required by gdm-smartcard-w 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                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_t:s0
Target Objects                coolkeypk11sGeneric CCID Reader 00 00-42 [ file ]
Source                        gdm-smartcard-w
Source Path                   /usr/libexec/gdm-smartcard-worker
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           gdm-plugin-smartcard-2.30.2-3.el6
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-21.el6
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed) 2.6.32-33.el6.i686 #1
                              SMP Thu Jun 3 12:54:59 EDT 2010 i686 i686
Alert Count                   1
First Seen                    Tue 15 Jun 2010 01:20:08 PM CEST
Last Seen                     Tue 15 Jun 2010 01:20:08 PM CEST
Local ID                      5baffa1c-0d2a-42e4-81b2-3ae63b5f79e5
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1276600808.364:66): avc:  denied  { create } for  pid=3544 comm="gdm-smartcard-w" name=636F6F6C6B6579706B31317347656E657269632043434944205265616465722030302030302D3432 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1276600808.364:66): arch=40000003 syscall=5 success=no exit=-13 a0=9151100 a1=4c2 a2=180 a3=9150808 items=0 ppid=1 pid=3544 auid=4294967295 uid=42 gid=477 euid=42 suid=42 fsuid=42 egid=477 sgid=477 fsgid=477 tty=(none) ses=4294967295 comm="gdm-smartcard-w" exe="/usr/libexec/gdm-smartcard-worker" subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  catchall,gdm-smartcard-w,xdm_t,var_t,file,create
audit2allow suggests:

#============= xdm_t ==============
allow xdm_t var_t:file create;

Comment 2 RHEL Program Management 2010-06-15 12:13:12 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Daniel Walsh 2010-06-16 16:03:26 UTC
What directory is this trying to create the file in?

/var/cache/coolkey

Should be labeled auth_cache_t.

restorecon -R -v /var/cache

Does this fix the problem?

Comment 4 Radek Bíba 2010-06-17 15:07:09 UTC
# restorecon -R -v /var/cache/
restorecon reset /var/cache/coolkey context unconfined_u:object_r:var_t:s0->system_u:object_r:auth_cache_t:s0
restorecon reset /var/cache/coolkey/coolkeypk11sGeneric CCID Reader 00 00-0 context unconfined_u:object_r:var_t:s0->system_u:object_r:auth_cache_t:s0

That looks like a reasonable change. I'm not really sure what triggered the original SELinux denial, though. I was just playing with smartcard settings in authconfig, pklogin_finder and gdmflexiserver. However, when I delete /var/cache/coolkey and re-run pklogin_finder, it gets recreated with the wrong context, unconfined_u:object_r:var_t:s0. I'm not sure what's wrong.

Comment 5 Daniel Walsh 2010-06-18 13:43:16 UTC
Is pklogin_finder creating the directory?  If yes then it needs to set the label correct.  Is the directory part of the payload of an application

rpm -qf /var/cache/coolkey

Comment 6 Radek Bíba 2010-06-18 14:00:47 UTC
Yes, like I said, when I rm -rf /var/cache/coolkey and run pklogin_finder again, it's recreated.

Rpm says that it's not owned by any package.

Comment 7 Daniel Walsh 2010-06-18 14:38:00 UTC
This directory should be in the pam_pkcs11 package and the tool should create the directory with the correct context.  You can just run restorecon on it,  or from code do a

if selinux_enabled() {
matchpathcon(path, mode, &con)
setfscreatecon(con);
}
mkdir /var/cache/coolkey
setfscreatecon(NULL);

Comment 8 Jack Magne 2010-07-12 16:27:50 UTC
It looks like the package coolkey is creating this directory.

Comment 9 RHEL Program Management 2010-07-15 15:01:07 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release. It has
been denied for the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 10 Bob Relyea 2010-07-23 23:26:28 UTC
The directory is supposed to be part of the coolkey library. (pklogin_finder doesn't really create it, it just runs libcoolkeypk11 which does. It was created in the package, but it looks like it wasn't listed in list of files for the package:

rpm -q -l coolkey
/usr/bin/pk11install
/usr/lib64/libckyapplet.so.1
/usr/lib64/libckyapplet.so.1.0.0
/usr/lib64/libcoolkeypk11.so
/usr/lib64/pkcs11/libcoolkeypk11.so
/usr/share/doc/coolkey-1.1.0
/usr/share/doc/coolkey-1.1.0/ChangeLog
/usr/share/doc/coolkey-1.1.0/LICENSE

I've added it to the package and now we have:/usr/bin/pk11install
/usr/lib64/libckyapplet.so.1
/usr/lib64/libckyapplet.so.1.0.0
/usr/lib64/libcoolkeypk11.so
/usr/lib64/pkcs11/libcoolkeypk11.so
/usr/share/doc/coolkey-1.1.0
/usr/share/doc/coolkey-1.1.0/ChangeLog
/usr/share/doc/coolkey-1.1.0/LICENSE
/var/cache/coolkey

My question is, is that sufficient?

bob

Comment 11 Daniel Walsh 2010-07-27 13:29:54 UTC
Well maybe.  As long as the directory in /var/cache/coolkey does not get removed.

Bob does coolkey has a startup/service script?

Comment 12 Bob Relyea 2010-07-27 18:37:52 UTC
OK, for 6.0 I'm ok with requiring a restorecon if someone removes it. I'll add it to the coolkey package.

coolkey does not run as a service. It's a library.

Comment 13 Daniel Walsh 2010-07-27 20:34:53 UTC
Great.

Comment 14 Bob Relyea 2010-07-28 17:46:00 UTC
Package: coolkey-1.1.0-15.el6
Tag: RHEL-6-candidate
Status: complete
Built by: rrelyea
ID: 138485
Started: Tue, 27 Jul 2010 17:19:19 EDT
Finished: Tue, 27 Jul 2010 17:21:22 EDT
Changelog:
* Tue Jul 27 2010 Bob Relyea <rrelyea> - 1.1.0-15
- Own the coolkey cache directory.
- Bugzilla #604086

Marking Modified. Dan, if you need to check anything in on the profile side, go ahead and change this back to assigned.

bob

Comment 16 Radek Bíba 2010-07-30 08:41:28 UTC
Thanks, the new package contains the cache directory, it gets created with the right context. The cache file in it has the right context too. I'm no longer getting the selinux denials using the steps that caused them in the past.

Comment 17 releng-rhel@redhat.com 2010-11-11 16:21:20 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


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