Bug 1350890

Summary: pcscd and gnome-settings-daemon run with high cpu after Gemalto card reader removal
Product: [Fedora] Fedora Reporter: Patrick C. F. Ernzer <pcfe>
Component: pcsc-liteAssignee: Bob Relyea <rrelyea>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 24CC: extras-qa, ian, johnh, klember, ludovic.rousseau+fedoraproject, ludovic.rousseau, nmavrogi, pcfe, rrelyea
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1349073 Environment:
Last Closed: 2016-07-06 16:36:47 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
pcscd log
none
pcscd log of a testrun where the coolkey RPM was not installed none

Description Patrick C. F. Ernzer 2016-06-28 15:33:11 UTC
Created attachment 1173496 [details]
pcscd log

This may well be a duplicate of 1349073

+++ This bug was initially created as a clone of Bug #1349073 +++


I can reproduce this already under gdm on my freshly booted F24, no need to log in to trigger the bug (although I also see it when logged in)

steps to reproduce:
1. boot up with Gemalto card reader plugegd in
2. ssh in as root and do
   killall pcscd ; LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu --color | tee log.txt
3. remove the Gemalto reader (it's USB attached in the PC Express slot. Furthermore it will get powered off when I am in an active session, due to an
echo 'auto' > /sys/bus/usb/devices/…/power/control
When investigating high CPU usage under F24 I came across the bug this is cloned from

actual result:
pcscd and gnome-settings-daemon eat up CPU cycles

expected result:
system handles removal of a USB smart card device just fine
(as users might disconnect or put the device in power saving mode with echo 'auto' > /sys/bus/usb/devices/…/power/control )

additional info:
# rpm -qa pcsc*
pcsc-lite-ccid-1.4.23-1.fc24.x86_64
pcsc-lite-ccid-debuginfo-1.4.23-1.fc24.x86_64
pcsc-lite-1.8.15-2.fc24.x86_64
pcsc-lite-libs-1.8.15-2.fc24.x86_64
pcsc-lite-devel-1.8.15-2.fc24.x86_64
pcsc-lite-debuginfo-1.8.15-2.fc24.x86_64


I've gzipped the log.txt and renamed it

The Gemalto Smart Card Readder used is a
ID 08e6:34ec Gemalto (was Gemplus) Compact Smart Card Reader Writer

Do tell if there any other logs you'd like.

Do close this as duplicate if you feel 1349073 and this are the same.

Comment 1 Ludovic Rousseau 2016-06-28 15:48:32 UTC
Same remark as in bug 1349073. The problem is with a software using the PC/SC library.

I do not use Fedora 24. I don't know what gnome-settings-daemon has loaded that cause this problem.
Look for a software that depends on libpcsclite1.

Comment 2 Ludovic Rousseau 2016-06-28 20:28:31 UTC
I installed a Fedora 24 with the default setup.

The package pcsc-lite-libs-1.8.15-2.fc24.x86_64 is used but:
- openconnect-7.06-4.fc24.x86_64
- pam_pkcs11-0.6.8-8.fc24.x86_64

pam_pkcs11 is configured to use libcoolkeypk11.so.
But coolkey is not (yet) installed in my system.

Patrick, I guess you have coolkey installed in your system. Right?

Comment 3 Patrick C. F. Ernzer 2016-07-04 07:40:11 UTC
Ludovic,

(In reply to Ludovic Rousseau from comment #2)
[...]
> Patrick, I guess you have coolkey installed in your system. Right?

Actually, I do.
coolkey-1.1.0-30.fc24.x86_64

I'll ditch that as I do not own any CoolKey and CAC products. My SmartCard usage is 'limited' to hardware from ReinerSCT (not on the affected box), Gemalto and Yubikey. No other SmartCard vendors in my zoo at the moment.

Need me to reproduce again or do you have a Gemalto reader to test with?
If you want me to test again, just set NEEDINFO on me.

Comment 4 Ludovic Rousseau 2016-07-04 07:55:06 UTC
Patrick,

Can you remove coolkey-1.1.0-30.fc24.x86_64 and check if you still have the problem?

Comment 5 Patrick C. F. Ernzer 2016-07-04 08:02:22 UTC
Found a time slot to reproduce with coolkey uninstalled.

1. boot with Gemalto reader plugged in (just to be sure to have clean slate)
2. ssh in as root and do
   killall pcscd ; LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu --color | tee Gemalto-20160704.txt
3. unplug Gemalto reader
4. check top, looks good. No more high CPU usage
5. re-plug Gemalto reader
6. check top again, still looks OK

So it seems that coolkey was indeed the culprit.

FWIW; until this morning I was not aware of coolkey hardware, the page directory.fedora.redhat.com/wiki/CoolKey seems down at the moment.

Comment 6 Patrick C. F. Ernzer 2016-07-04 08:03:49 UTC
Created attachment 1175848 [details]
pcscd log of a testrun where the coolkey RPM was not installed