Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1491922

Summary: `gdm-session-worker` segfaults repeatedly when Smart Card is inserted
Product: Red Hat Enterprise Linux 7 Reporter: Josip Vilicic <jvilicic>
Component: pam_pkcs11Assignee: Bob Relyea <rrelyea>
Status: CLOSED ERRATA QA Contact: Asha Akkiangady <aakkiang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: cobrown, jvilicic, rpattath
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pam_pkcs11-0.6.2-28.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:00:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
This is the abrt output from the customer
none
pam_pkcs11 conf none

Description Josip Vilicic 2017-09-15 03:25:12 UTC
Description of problem:
`gdm-session-worker` segfaults repeatedly when Smart Card is inserted


Version-Release number of selected component (if applicable):
Gemalto DoD CAC/SmartCard
opensc-0.16.0-5.20170227git777e2a3.el7.x86_64     Thu Sep  7 10:43:02 2017
gdm-3.22.3-12.el7.x86_64         Thu Sep  7 11:14:11 2017


How reproducible:
Consistent


Steps to Reproduce:
1. Configure opensc to handle SmartCards
2. Insert SmartCard


Actual results:
1) CAC Reader flashes red and the login screen flickers rapidly.

2) /var/log/messages shows many of these errors:

   Sep 13 11:44:29 wsdev33 abrt-hook-ccpp: Process 29549 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:29 wsdev33 abrt-hook-ccpp: Process 29553 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:29 wsdev33 abrt-hook-ccpp: Process 29557 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:29 wsdev33 abrt-hook-ccpp: Process 29561 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:29 wsdev33 abrt-hook-ccpp: Process 29565 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:30 wsdev33 abrt-hook-ccpp: Process 29569 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:30 wsdev33 abrt-hook-ccpp: Process 29573 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:30 wsdev33 abrt-hook-ccpp: Process 29577 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)
   Sep 13 11:44:30 wsdev33 abrt-hook-ccpp: Process 29581 (gdm-session-worker) of user 0 killed by SIGSEGV - ignoring (repeated crash)


Expected results:
Getting prompted for SmartCard PIN


Additional info:
Coolkey seems to read the CAC properly but requests a password instead of PIN, so we were thinking this was just a configuration issue.  We asked the customer to switch over to opensc instead since they're on 7.4 and ran into the error we're opening this bug for.

Comment 2 Jakub Jelen 2017-09-15 06:38:30 UTC
Please, provide a coredump or backtrace from the crashing process. Without it, I can not even guess what could go wrong in opensc nor in gnome.

Comment 3 Jakub Jelen 2017-09-15 06:49:44 UTC
It would be also useful to see some more information about the card, if it is readbale using pkcs11-tool or p11tool.

Comment 4 Corey Brown 2017-09-18 21:39:51 UTC
Created attachment 1327633 [details]
This is the abrt output from the customer

Comment 5 Jakub Jelen 2017-09-19 10:31:57 UTC
The backtrace in the attachment ends in the pam_pkcs11 (moving to this component). Investigating the coredump further we can see the following:

#1  0x00007f0c53b76602 in scconf_item_find (parser=0x7fffa9299130, parser=0x7fffa9299130, 
    key=<optimized out>) at parse.c:85
85			    strcasecmp(item->key, parser->key) == 0) {
(gdb) l
80	{
81		scconf_item *item;
82	
83		for (item = parser->block->items; item; item = item->next) {
84			if (item->type == SCCONF_ITEM_TYPE_VALUE &&
85			    strcasecmp(item->key, parser->key) == 0) {
86				return item;
87			}
88		}
89		return item;
(gdb) p item
$1 = (scconf_item *) 0x55d7e4717310
(gdb) p *item
$2 = {next = 0x55d7e46f4f40, type = 2, key = 0x55d7e4713480 "nullok", value = {
    comment = 0x55d7e4714e50 "", block = 0x55d7e4714e50, list = 0x55d7e4714e50}}
(gdb) p *item->key
$3 = 110 'n'
(gdb) p parser
$4 = (scconf_parser *) 0x7fffa9299130
(gdb) p *parser
$5 = {config = 0x55d7e4714fc0, block = 0x55d7e4713550, last_item = 0x55d7e4717c80, 
  current_item = 0x55d7e4717c80, key = 0x0, name = 0x55d7e4717cb0, state = 17, last_token_type = 2, 
  line = 33, error = 0, warnings = 0, emesg = '\000' <repeats 255 times>}
(gdb) p *parser->key
Cannot access memory at address 0x0

This is happening during parsing of the file /etc/pam_pkcs11/pam_pkcs11.conf (can you attach the content of this file from customer machine -- it is not in the sosreport). Even though the file can have a typo, the pam_pkcs11 should not crash.

Comment 6 Bob Relyea 2017-09-19 18:56:42 UTC
need the /etc/pam_pkcs11/pam_pkcs11.conf on the crashing machine.

Comment 7 aheverle 2017-09-22 13:56:15 UTC
Created attachment 1329590 [details]
pam_pkcs11 conf

Comment 9 Bob Relyea 2017-11-01 23:58:00 UTC
fixed in pam_pkcs11-0.6.2-28.el7

Comment 13 Roshni 2017-12-18 18:45:01 UTC
[root@dhcp129-107 ~]# rpm -qi pam_pkcs11
Name        : pam_pkcs11
Version     : 0.6.2
Release     : 28.el7
Architecture: x86_64
Install Date: Tue 28 Nov 2017 04:11:05 PM EST
Group       : System Environment/Base
Size        : 1101210
License     : LGPLv2+
Signature   : RSA/SHA256, Wed 01 Nov 2017 08:33:05 PM EDT, Key ID 199e2f91fd431d51
Source RPM  : pam_pkcs11-0.6.2-28.el7.src.rpm
Build Date  : Wed 01 Nov 2017 07:05:25 PM EDT
Build Host  : x86-030.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://www.opensc-project.org/pam_pkcs11
Summary     : PKCS #11/NSS PAM login module

[root@dhcp129-107 ~]# rpm -qi opensc
Name        : opensc
Version     : 0.16.0
Release     : 7.20170227git777e2a3.el7
Architecture: x86_64
Install Date: Mon 18 Dec 2017 01:10:47 PM EST
Group       : System Environment/Libraries
Size        : 3262790
License     : LGPLv2+
Signature   : RSA/SHA256, Thu 09 Nov 2017 08:06:31 AM EST, Key ID 199e2f91fd431d51
Source RPM  : opensc-0.16.0-7.20170227git777e2a3.el7.src.rpm
Build Date  : Thu 09 Nov 2017 07:40:40 AM EST
Build Host  : x86-039.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : https://github.com/OpenSC/OpenSC/wiki
Summary     : Smart card library and applications
.
[root@dhcp129-107 ~]# rpm -qi gdm
Name        : gdm
Epoch       : 1
Version     : 3.26.2.1
Release     : 3.el7
Architecture: x86_64
Install Date: Tue 28 Nov 2017 04:09:08 PM EST
Group       : User Interface/X
Size        : 2270157
License     : GPLv2+
Signature   : (none)
Source RPM  : gdm-3.26.2.1-3.el7.src.rpm
Build Date  : Wed 15 Nov 2017 11:14:53 AM EST
Build Host  : x86-020.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://download.gnome.org/sources/gdm
Summary     : The GNOME Display Manager


Does not see the issues mentioned in the bug bug description. Successful gdm login using alt token and other CAC cards.

Comment 16 errata-xmlrpc 2018-04-10 18:00:01 UTC
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.

https://access.redhat.com/errata/RHBA-2018:0961