Bug 1286320
| Summary: | pcscd generates massive CPU load | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | mathewm770 | |
| Component: | coolkey | Assignee: | Bob Relyea <rrelyea> | |
| Status: | CLOSED ERRATA | QA Contact: | Asha Akkiangady <aakkiang> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 7.2 | CC: | arubin, jhunt, johnh, mrjones69, rduda, rpattath, rrelyea | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | x86_64 | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | coolkey-1.1.0-35.el7 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1352161 (view as bug list) | Environment: | ||
| Last Closed: | 2016-11-04 06:52:18 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: | 1352161 | |||
|
Description
mathewm770
2015-11-28 01:20:56 UTC
Sorry, missed a couple of fields. Description of problem: pcscd generates massive CPU load when used with USB smart cards Version-Release number of selected component (if applicable): pcsc-lite-1.8.8-6.el7.x86_64 pcsc-lite-ccid-1.4.10-10.el7.x86_64 pcsc-lite-libs-1.8.8-6.el7.x86_64 I can produce this issue reliably with a slightly different use-case. After using the smartcard to access webmail (Firefox), I log out of email, close the browser and then remove the card from the reader. The pcscd process immediately jumps to 170% - 250% in top and stays there. Putting the smartcard back into the reader causes it to cease immediately. Then you can make it happen and make it stop by removing and reinserting the card any number of times. I installed the pcsc-lite debuginfo package and attached gdb while it was in the high CPU state. The problem is in winscard_svc.c around line 363 in the CMD_GET_READERS_STATE case. While the card is removed, there is a hard loop going on here where the RFWaitForReaderInit() and MessageSend() both return very quickly and then the outer while loop iterates again. Nothing in the sequence ever blocks or takes a break, resulting in the high CPU usage. Related to bug 1343096 This problem seems to also occur on Fedora 24. I see both pcscd and gnome-settings running at high CPU after a Yubikey NEO is removed. It looks like ubuntu found it in March: https://bugs.launchpad.net/ubuntu/+source/pcsc-lite/+bug/1551897 and upstream has a fix (from the Ubuntu bug report): https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=pcsclite/CCID.git;a=commitdiff_plain;h=3c21f452543983f3625a1965ce234074cbda6865 Not clear the Fedora 24 problem is the same as here. I opened a fedora ticket as https://bugzilla.redhat.com/show_bug.cgi?id=1349073 I can simulate this issue with a normal reader by pluging and unpluging the reader with a card inserted. Start Firefox. run top unplug the reader. Not PCSC run to 100% or more of the cpu (depending on the number of cores). The ubuntu patch is in pcsc-lite-ccid. I've coded a version of that patch, but it doesn't affect RHEL. If there is a second problem we can add that patch to pcsc-lite. The issue actually appears to be in libcoolkey I've move the component to coolkey to pick up the coolkey fix. fixed in coolkey-1.1.0-35.el7 Bob Relyea (or anyone), can you provide a URL to coolkey-1.1.0-35.el7 source in the REHL build system? (If it's available.) I would like to see if it addresses bug #1349073. Also, what specific binary includes libcoolkey? I don't see either in the ldd list of pcscd or gnome-settings-daemon on either CentOS7 nor on Fedora 24. > Bob Relyea (or anyone), can you provide a URL to coolkey-1.1.0-35.el7 source > in the REHL build system? (If it's available.) I would like to see if it > addresses bug #1349073. I believe it's still internal until 7.3 is released. > Also, what specific binary includes libcoolkey? I don't see either in the ldd > list of pcscd or gnome-settings-daemon on either CentOS7 nor on Fedora 24. It won't show up in ldd. It' dlopen'ed as a PKCS #11 module. NSS will open it, so anything that include libnss3.so would potentially use it, but so would certain apps that use openssl (like ssh). There are several apps that use the WaitForSlotEvent() call, including firefox, thunderbird and esc (the latter, if installed is running as a daemon looking for smart card insertions). bob Wrt comment:13: thanks for both comments. I'll follow-up at bug #1349073. Reproduced the issue using coolkey-1.1.0-35.el7 1. Open firefox when reader is inserted 2. top | grep pcscd 2797 root 20 0 486256 1840 1300 S 0.3 0.0 0:00.36 pcscd 2797 root 20 0 486256 1840 1300 S 0.3 0.0 0:00.37 pcscd 2797 root 20 0 481960 1812 1180 S 47.2 0.0 0:01.79 pcscd 2797 root 20 0 481960 1812 1180 S 166.4 0.0 0:06.80 pcscd 2797 root 20 0 481960 1812 1180 S 164.1 0.0 0:11.74 pcscd 2797 root 20 0 481960 1812 1180 S 166.0 0.0 0:16.72 pcscd 2797 root 20 0 481960 1812 1180 S 165.4 0.0 0:21.70 pcscd 2797 root 20 0 481960 1812 1180 S 164.8 0.0 0:26.66 pcscd 2797 root 20 0 481960 1812 1180 S 170.4 0.0 0:31.79 pcscd 2797 root 20 0 481960 1812 1180 S 165.8 0.0 0:36.78 pcscd 2797 root 20 0 486256 2048 1292 S 108.0 0.0 0:40.02 pcscd 2797 root 20 0 486256 2048 1292 S 0.3 0.0 0:40.03 pcscd 2797 root 20 0 486256 2048 1292 S 0.3 0.0 0:40.04 pcscd 2797 root 20 0 486256 2048 1292 S 0.3 0.0 0:40.05 pcscd The reader was removed after 0:00:37 Upgraded to: Name : coolkey Version : 1.1.0 Release : 35.el7 Architecture: x86_64 Install Date: Wed 03 Aug 2016 03:03:19 PM EDT Group : System Environment/Libraries Size : 300220 License : LGPLv2 Signature : RSA/SHA256, Thu 28 Jul 2016 01:24:44 PM EDT, Key ID 938a80caf21541eb Source RPM : coolkey-1.1.0-35.el7.src.rpm Build Date : Fri 01 Jul 2016 05:09:30 PM EDT Build Host : x86-034.build.eng.bos.redhat.com Relocations : (not relocatable) Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Vendor : Red Hat, Inc. URL : http://directory.fedora.redhat.com/wiki/CoolKey Summary : CoolKey PKCS #11 module Repeated the steps as above [rpattath@dhcp129-54 ~]$ top | grep pcscd 2786 root 20 0 486256 3892 1300 S 0.3 0.0 0:00.34 pcscd 2786 root 20 0 486256 3892 1300 S 0.3 0.0 0:00.35 pcscd 2786 root 20 0 481960 3864 1180 S 0.7 0.0 0:00.37 pcscd 2786 root 20 0 481960 3864 1180 S 0.3 0.0 0:00.38 pcscd 2786 root 20 0 481960 3864 1180 S 0.3 0.0 0:00.39 pcscd 2786 root 20 0 481960 3864 1180 S 0.3 0.0 0:00.40 pcscd 2786 root 20 0 486256 4100 1292 S 0.3 0.1 0:00.41 pcscd 2786 root 20 0 486256 4100 1292 S 0.7 0.1 0:00.43 pcscd The reader was removed after 0:00:35 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-2016-2465.html *** Bug 1348586 has been marked as a duplicate of this bug. *** |