Segmentation fault in eglibc if usbfs_path is NULL and usbfs_get_device_list get called afterwards
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libusbx (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Basically this bug exist from 1.0.12 to 1.0.16 (so this may affect Saucy as well)
Tested under Hyper-V Ubuntu 13.04 (Raring) with linux-virtual kernel and targeted driver (using netinstall iso).
So I have got this bug when I was running the steam client binary (yes, I know that this may also be a problem created by steam client itself as it ignores the value returned by op_init, but I think it would be to make the libusbx to become a fail proof library. And I will report this bug to valve as well) in Hyper VM (Raring), without any predefined usbfs path on it.
As there is no dbg build for libusb-1.0.12 atm, I have built one on my own and here is what I have got with gdb attached to steam client binary.
-------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xecf00b40 (LWP 40013)]
__opendirat (dfd=dfd@
at ../sysdeps/
90 ../sysdeps/
(gdb) frame 2
#2 0xec2e460e in usbfs_get_
at os/linux_
1088 DIR *buses = opendir(
-------
(Frame 1 is simply a opendir function which passed the NULL pointer to opendirat in eglibc)
Afterwards, I have recompiled the libusb 1.0.12 with following lines added to the usbfs_get_
-------
static int usbfs_get_
struct discovered_devs **_discdevs)
{
if (!usbfs_path) {
usbi_err(ctx, "could not find usbfs");
return LIBUSB_ERROR_OTHER;
}
struct dirent *entry;
DIR *buses = opendir(
-------
And steam client is working like a charm again.
Therefore I want to ask can you guys consider to add a check within usbfs_get_
Best regards,
UnknownzD
Status changed to 'Confirmed' because the bug affects multiple users.