Bug 1299992

Summary: Smartcard: Lock-on-remove fails with Gemalto/Safenet eToken 4100 and Safenet Authentication Client
Product: Red Hat Enterprise Linux 6 Reporter: Ashish Shah <ashishks>
Component: gnome-settings-daemonAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.7CC: alanm, ashishks, cparadka, mboisver, mkolaja, rstrode, tpelka
Target Milestone: rcKeywords: OtherQA, Reopened, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gnome-settings-daemon-2.28.2-39.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1400134 1427417 (view as bug list) Environment:
Last Closed: 2017-03-21 11:02:45 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:
Bug Depends On:    
Bug Blocks: 1269194, 1363705, 1400134, 1427417    
Attachments:
Description Flags
messages logs captured at the time of issue
none
while /usr/libexec/gnome-settings-daemon --no-daemon --debug; do pkill -f gnome-settings-daemon; done |& tee settings-daemon.output
none
gconf dump from uer's session none

Description Ashish Shah 2016-01-19 17:11:35 UTC
Created attachment 1116276 [details]
messages logs captured at the time of issue

Description of problem:

GNOME desktop does not lock upon removal of smartcard used to login to the session.
gnome-settings-daemon is segfaulting at the time of issue
---
gnome-settings-[4202]: segfault at 18 ip 00007f3cb83d6f90 sp 00007fffbe946898 error 4 in libsmartcard.so[7f3cb83d3000+9000]
---

Version-Release number of selected component (if applicable):

Red Hat Enterprise Linux 6
gnome-settings-daemon-2.28.2-31.el6.x86_64
SafenetAuthenticationClient-9.0.43-0.x86_64

How reproducible:
Customer is able to reproduce this in physical and virtual environments, and on CentOS

Steps to Reproduce:

1. Configure rhel6.7 system for smartcard authentication with Safenet Authentication Client
2. Configure system to lock the session upon removal of smartcard
3. Login using smartcard
4. After logging in to session, remove smartcard

Actual results:
Screen not getting locked upon removal of smartcard
gnome-settings-daemon is segfaulting

Expected results:
Screen should get immediately locked upon removal of smartcard

Additional info:
Red Hat Bug #1243243 is reported with similar traceback for gdm as that of gnome-settings-daemon here.

Comment 1 Ashish Shah 2016-01-19 17:13:42 UTC
Created attachment 1116277 [details]
while /usr/libexec/gnome-settings-daemon --no-daemon --debug; do pkill -f gnome-settings-daemon; done |& tee settings-daemon.output

backtrace captured from g-s-d core:


Core was generated by `/usr/libexec/gnome-settings-daemon'.
Program terminated with signal 11, Segmentation fault.
#0  gsd_smartcard_get_name (card=0x0) at gsd-smartcard.c:230
230	        return g_strdup (card->priv->name);
(gdb) 
(gdb) 
(gdb) bt full
#0  gsd_smartcard_get_name (card=0x0) at gsd-smartcard.c:230
No locals.
#1  0x00007f878ec8b35c in gsd_smartcard_manager_get_all_cards (manager=0x1dd5980, 
    error=<value optimized out>) at gsd-smartcard-manager.c:855
        card = 0x0
        slot_id = <value optimized out>
        slot_series = <value optimized out>
        card_name = <value optimized out>
        worker = 0x1dab240
        node = 0x1df7d60
        i = <value optimized out>
#2  gsd_smartcard_manager_start (manager=0x1dd5980, error=<value optimized out>)
    at gsd-smartcard-manager.c:965
        nss_error = 0x0
#3  0x00007f878ec89c01 in impl_activate (plugin=<value optimized out>)
    at gsd-smartcard-plugin.c:282
        error = 0x0
        smartcard_plugin = 0x1dab200
#4  0x0000000000405b2d in _activate_plugin (info=0x1db04e0)
    at gnome-settings-plugin-info.c:497
        res = 1
#5  gnome_settings_plugin_info_activate (info=0x1db04e0) at gnome-settings-plugin-info.c:520
        __PRETTY_FUNCTION__ = "gnome_settings_plugin_info_activate"
#6  0x00000000004046f5 in maybe_activate_plugin (info=0x1db04e0, 
    user_data=<value optimized out>) at gnome-settings-manager.c:94
        res = <value optimized out>
#7  0x00007f879efc218c in g_slist_foreach (list=<value optimized out>, 
    func=0x4046e0 <maybe_activate_plugin>, user_data=0x0) at gslist.c:880
        next = 0x1db2480
#8  0x000000000040517e in _load_all (manager=0x1daac00, error=<value optimized out>)
    at gnome-settings-manager.c:263
No locals.
#9  gnome_settings_manager_start (manager=0x1daac00, error=<value optimized out>)
    at gnome-settings-manager.c:349
        ret = 0
        __PRETTY_FUNCTION__ = "gnome_settings_manager_start"
#10 0x00000000004044f1 in main (argc=1, argv=0x7fff5ea6fc28) at main.c:478
        manager = 0x1daac00
        bus = 0x1da67e8
        res = <value optimized out>
        error = 0x0
        __PRETTY_FUNCTION__ = "main"
(gdb)

Comment 2 Ashish Shah 2016-01-19 17:15:46 UTC
Created attachment 1116278 [details]
gconf dump from uer's session

Output of modutil command..

cat 70-secmod.output 

Listing of PKCS #11 Modules
-----------------------------------------------------------
  1. NSS Internal PKCS #11 Module
	 slots: 2 slots attached
	status: loaded

	 slot: NSS Internal Cryptographic Services
	token: NSS Generic Crypto Services

	 slot: NSS User Private Key and Certificate Services
	token: NSS Certificate DB

  2. eToken
	library name: /usr/lib64/libeTPkcs11.so
	 slots: 10 slots attached
	status: loaded

	 slot: Alcor Micro AU9520 00 00
	token: SafeNet eToken 4100

	 slot: 
	token: 

	 slot: 
	token: 

	 slot: 
	token: 

	 slot: ETOKEN HID READER 0
	token: 

	 slot: ETOKEN HID READER 1
	token: 

	 slot: ETOKEN HID READER 2
	token: 

	 slot: ETOKEN HID READER 3
	token: 

	 slot: 
	token: 

	 slot: 
	token: 
-----------------------------------------------------------

Comment 3 Ashish Shah 2016-01-26 04:31:10 UTC
Hello,

Could empty Slot: and token: fields in above output be the cause of issue?
How should we proceed with this? Any hint on further debugging steps if needed?

Thanks,
Ashish

Comment 4 Ray Strode [halfline] 2016-02-01 21:56:20 UTC
yea, it's a bug in the code.  we need to handle that.

Comment 22 Ray Strode [halfline] 2016-11-07 18:38:14 UTC
Upon close evaluation of this defect report, Engineering believes the issue has been adequately addressed by the bug fix update RHBA-2016-0962, which was released as part of Red Hat Enterprise Linux 6.8.  The details of the RHBA-2016-0962 bug fix update are available here:

https://rhn.redhat.com/errata/RHBA-2016-0962.html

Please confirm that Red Hat Enterprise Linux 6.8 works as expected.

Comment 32 Michael Boisvert 2016-12-20 16:38:35 UTC
Hi Ashish, are you able to have the customer test this issue with the latest packages and report the results back here?

Comment 48 errata-xmlrpc 2017-03-21 11:02:45 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://rhn.redhat.com/errata/RHBA-2017-0705.html