Red Hat Bugzilla – Bug 469593
Fix for libusb hotplug garbage when serial number is empty
Last modified: 2009-12-21 01:50:23 EST
Created attachment 322251 [details]
Patch to apply to hotplug_libusb.c
Description of problem:
I am writing an ifd driver for an USB smartcard reader.
It seems that this reader doesn't have an USB "serial number" property defined.
When detecting the reader, PCSC-lite adds random garbage to the reader name, and there is some memory corruption which
prevent the normal function of the PCSC stack.
(PCSC-lite is compiled with ADD_SERIAL_NUMBER)
I traced this problem back to the file hotplug_libusb.c and provide a simple fix to this problem.
With this patch, the problem is gone, the driver does function normally and there is no garbage neither in the logs
or in the reader name.
Version-Release number of selected component (if applicable):
Not easy : you have to use PCSC-lite with an USB Smartcard reader which DOES NOT have an USB Serial Number defined.
The reader is an Infinity USB Unlimited ( http://www.infinityusb.com/default.asp?show=productsdetail&ProductID=11 ), here is the "lsusb -v" output :
Bus 005 Device 047: ID 104f:0004
bDeviceClass 0 (Defined at Interface level)
iManufacturer 1 WB Electronics
iProduct 2 Infinity USB Unlimited
To reproduce, you also have to have a driver for this reader, and since I haven't released one yet, it's not that easy.
Steps to Reproduce:
1. Plug the reader in
2. look at the log
(Random garbage appended to the reader name)
Nov 2 21:28:49 xps pcscd: readerfactory.c:1113:RFInitializeReader() Attempting startup of IUSB (#010¢#004¸#030¢#004¸ß<97>þ#002#010¢#004¸#010¢#004¸$<9c>O) 00 00 using /usr/lib/pcsc/drivers/ifd-iuu.bundle/Contents/Linux/libiuu.so.1.0.0
(No serial number)
Nov 2 21:28:49 xps pcscd: readerfactory.c:1113:RFInitializeReader() Attempting startup of IUSB 00 00 using /usr/lib/pcsc/drivers/ifd-iuu.bundle/Contents/Linux/libiuu.so.1.0.0
* In the patch, I completely suppress the serial number output if there is an error retrieving the serial number property (len <= 0 denotes an error or an empty string)
* I've sent the patch upstream to PCSC developpers, so may be it'll be fixed in the current sources one day.
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '9'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 9's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 9 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.
More information and reason for this action is here:
The patch was applied upstream in 1.5.0 release: svn://svn.debian.org/pcsclite/trunk/PCSC@3197 and is also thus in Fedora by now. Closing the ticket.