Bug 469593 - Fix for libusb hotplug garbage when serial number is empty
Fix for libusb hotplug garbage when serial number is empty
Product: Fedora
Classification: Fedora
Component: pcsc-lite (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bob Relyea
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-11-02 18:40 EST by Ludovic LANGE
Modified: 2009-12-21 01:50 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-12-21 01:50:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to apply to hotplug_libusb.c (94 bytes, text/plain)
2008-11-02 18:40 EST, Ludovic LANGE
no flags Details

  None (edit)
Description Ludovic LANGE 2008-11-02 18:40:11 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):

How reproducible:
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  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x104f 
  idProduct          0x0004 
  bcdDevice            1.00
  iManufacturer           1 WB Electronics
  iProduct                2 Infinity USB Unlimited
  iSerial                 3 
  bNumConfigurations      1

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
Actual results:
(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

Expected results:
(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

Additional info:
* 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.
Comment 1 Bug Zapper 2009-06-09 23:09:16 EDT
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: 
Comment 2 Bug Zapper 2009-11-16 04:34:40 EST
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:
Comment 3 Kalev Lember 2009-12-21 01:50:23 EST
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.

Note You need to log in before you can comment on or make changes to this bug.