Excessive CPU utilization
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ccid (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
pcsc-lite (Debian) |
Fix Released
|
Unknown
|
|||
pcsc-lite (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[Impact]
When hotplugging a composite USB device that expose multiple interfaces (such as a Yubikey NEO or Yubikey 4), libccid does not correctly de-initialize the USB library when it skips over the non-CCID interface.
This subsequently results in pcscd (or, presumably, anything that loads libccid, though I don't think anything else does) either using 100% CPU or segfaulting when the device is unplugged.
This seems worthy of an SRU as it is an easily reproducible bug with a simple, targeted fix.
[Test Case]
1. Make sure pcscd is running (sudo systemctl start pcscd; possibly sudo systemctl restart pcscd if a potentially fixed package has just been installed)
2. Plug and then unplug a composite USB device that includes a CCID interface (such as a Yubikey NEO)
3. Observe that pcscd has crashed with a segfault (sudo systemctl status pcscd)
[Regression Potential]
The patch is quite narrow, and thus the potential for regression should be limited. The new code adds calls to close_libusb_
The worst case here is likely an unexpected call to libusb_exit, which could cause libusb to get into an inconsistent state. However, in practice the call seems quite safe, and the likelihood of regression low.
======
Original bug description:
In xenial, pcscd CPU utilization occasionally goes haywire:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27404 root 20 0 384264 4992 2228 S 100.3 0.0 75:39.03 /usr/sbin/pcscd --foreground --auto-exit
I get this about once a day since installing xenial. I can't quite connect it to any specific event on the system, it just seems to happen sporadically -- fan turns on, I run top, and there it is again.
Never had this issue on same hardware incl. smartcard with trusty.
I wonder if it might be this? https:/
Changed in pcsc-lite (Debian): | |
status: | Unknown → Confirmed |
Changed in pcsc-lite (Debian): | |
status: | Confirmed → Fix Released |
Changed in ccid (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in ccid (Ubuntu): | |
status: | New → Fix Released |
Changed in pcsc-lite (Ubuntu): | |
status: | Confirmed → Invalid |
Changed in pcsc-lite (Ubuntu Xenial): | |
status: | New → Invalid |
description: | updated |
description: | updated |
Changed in ccid (Ubuntu Xenial): | |
status: | Confirmed → In Progress |
This is what I've got installed ^^
c@mawhrin- skel:~/ omnibus- layers$ dpkg -l | grep pcscd
ii pcscd 1.8.14-1ubuntu1 amd64 Middleware to access a smart card using PC/SC (daemon side)