Bug 801854

Summary: spicec crashes (segfaults) when smartcard reader is plugged while guest expects smartcard auth
Product: Red Hat Enterprise Linux 6 Reporter: David Jaša <djasa>
Component: spice-clientAssignee: Alon Levy <alevy>
Status: CLOSED WONTFIX QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, alevy, cfergeau, dblechte, mkenneth, mkrcmari, syeghiay
Target Milestone: rc   
Target Release: 6.3   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 802435 (view as bug list) Environment:
Last Closed: 2012-08-01 13:44:11 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:
Bug Depends On: 802435, 806038, 811314, 975600    
Bug Blocks: 840699    
Attachments:
Description Flags
backtrace
none
pcscd debug output from card insertion to client segfault none

Description David Jaša 2012-03-09 16:32:28 UTC
Created attachment 568960 [details]
backtrace

Description of problem:
spicec crashes (segfaults) when smartcard is plugged while guest expects smartcard auth

Version-Release number of selected component (if applicable):
spice-client-0.8.2-13.el6.x86_64
coolkey-1.1.0-19.el6.x86_64
pcsc-lite-1.5.2-6.el6.x86_64

How reproducible:
always

Steps to Reproduce:
0. unplug the reader from the client
1. boot up the RHEL guest to smartcard-enabled gdm
2. (optional: select "smartcard authentication")
3. run spicec --smartcard <other opts>
4. plug the smartcard reader
  
Actual results:
spicec crashes with segmentation fault

Expected results:
spicec continues running

Additional info:
  * does not happen when sc reader is already plugged in at the launch of spicec
  * messages in log (with DEBUG level) from reader insertion to the crash:
1331309793 INFO [23904:23916] SmartCardChannel::cac_card_events_thread_main: VEVENT_READER_INSERT
1331309793 INFO [23904:23904] SmartCardChannel::add_unallocated_reader: adding unallocated reader 0x960dc0
  * log messages when reader is plugged at spicec launch and spiced does
    not crash:
1331310580 INFO [2326:2338] SmartCardChannel::cac_card_events_thread_main: VEVENT_READER_INSERT
1331310580 INFO [2326:2326] SmartCardChannel::add_unallocated_reader: adding unallocated reader 0x28bae60
1331310580 INFO [2326:2338] SmartCardChannel::cac_card_events_thread_main: VEVENT_CARD_INSERT
1331310580 INFO [2326:2326] SmartCardChannel::add_reader: adding 0x28bae60->0
   * log messages when user removes and re-inserts smartcard:
1331310684 INFO [2326:2338] SmartCardChannel::cac_card_events_thread_main: VEVENT_CARD_REMOVE
1331310691 INFO [2326:2338] SmartCardChannel::cac_card_events_thread_main: VEVENT_CARD_INSERT
1331310692 DEBUG [2326:2326] SmartCardChannel::send_atr: ATR: 
1331310692 DEBUG [2326:2326] VSCMessageEvent::response:   31: recv APDU: 
1331310692 DEBUG [2326:2326] VSCMessageEvent::response:  sent APDU:

Comment 1 David Jaša 2012-03-09 16:43:29 UTC
Created attachment 568961 [details]
pcscd debug output from card insertion to client segfault

Comment 3 Alon Levy 2012-04-18 13:54:00 UTC
So the issue with this bug:
 - there is an underlying problem that is not spicec related (even though the direct reason for a segfault of course is). See bugs:
 * bug 802435 . libcacard, POST, pushed upstream (no component yet, won't help without coolkey updated)
 * bug 806038, coolkey. patches attached, but ASSIGNED due to regression.
 * bug 811314, nss, fix by rrelyea for a regression caused by the coolkey fix.

I'll fix the segfault, but that would still leave us with a "smartcard not working if reader plugged in after spicec started" just like the remote-viewer cloned bug, now libcacard (802435)

For an explanation of the actual problem see bug 802435 comment 5.

Alon

Comment 4 David Blechter 2012-04-18 14:11:46 UTC
moving to 6.4, depend on 802435

Comment 5 Alon Levy 2012-04-18 14:20:54 UTC
Adding dependency on 806038, 811314

Comment 8 Marian Krcmarik 2012-08-01 13:44:11 UTC
Closing as WONTFIX, spice-client was replaced by virt-viewer which is now supported client. This bug was not reproducible with virt-viewer, If you can reproduce with remote-viewer, please file a bug for virt-viewer. Thanks.