linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Drake <dsd@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: usb_id segfaulting on 2.6.23
Date: Mon, 15 Oct 2007 12:29:39 +0000	[thread overview]
Message-ID: <47135D33.7080805@gentoo.org> (raw)

Hi,

Since upgrading to 2.6.23, usb_id is segfaulting when dealing with my 
input devices. I'm using udev-116. I can get an instant segfault simply 
by replugging my keyboard.

I have dug around a bit. The segfault happens inside usb_id, see the 
"fallback" section.

It reaches here:
		dbg("No USB vendor information available\n");
		sprintf(vendor_str,"0000");

then a few lines later:

		set_str(vendor_str,usb_vendor, sizeof(vendor_str) - 1);

usb_vendor is NULL. set_str does various string manipulations with this 
NULL pointer which causes the segfault.

I suggest fixing this by replacing the sprintf line with:
	usb_vendor = "0000";

The same bug exists a few lines below with the USB model handling.


Now for what actually caused the change in behaviour: the devpath passed 
to usb_id has changed between 2.6.22 and 2.6.23.

In 2.6.22, it was /class/input/input4/event2 and I would get this output:

> # /lib/udev/usb_id /class/input/input4/event2
> Microsoft_Microsoft_Keyboard_with_Fingerprint_Reader_{3A1B506A-BB77-444C-851B-C424997B2763}
> ID_VENDOR=Microsoft
> ID_MODEL=Microsoft_Keyboard_with_Fingerprint_Reader
> ID_REVISION\x0100
> ID_SERIAL=Microsoft_Microsoft_Keyboard_with_Fingerprint_Reader_{3A1B506A-BB77-444C-851B-C424997B2763}
> ID_SERIAL_SHORT={3A1B506A-BB77-444C-851B-C424997B2763}
> ID_TYPE=hid
> ID_BUS=usb

In 2.6.23 the devpath now provided to usb_id is 
/devices/pci0000:00/0000:00:02.0/usb2/2-2/2-2:1.0/input/input13/event2

After applying my segfault fixes I get the following from usb_id:
> # /lib/udev/usb_id /devices/pci0000:00/0000:00:02.0/usb2/2-2/2-21.0/input/input13/event2
> 0000_0000

Why has the devpath changed? Is this a kernel bug for breaking userspace 
compat? Or should usb_id just be adapted to be able to handle both types 
of devpath?

Thanks!
Daniel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

             reply	other threads:[~2007-10-15 12:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 12:29 Daniel Drake [this message]
2007-10-15 12:41 ` usb_id segfaulting on 2.6.23 Kay Sievers
2007-10-15 12:58 ` Kay Sievers
2007-10-15 13:07 ` Daniel Drake
2007-10-15 21:19 ` Kay Sievers
2007-10-16 18:15 ` Kay Sievers
2007-11-06  0:42 ` Daniel Drake
2007-11-06  2:26 ` Kay Sievers
2007-11-06  7:42 ` Oliver Neukum
2007-11-06 11:47 ` Daniel Drake
2007-11-06 12:38 ` Oliver Neukum
2007-11-06 14:11 ` Oliver Neukum
2007-11-06 15:03 ` Daniel Drake
2007-11-06 16:11   ` Alan Stern
2007-11-06 16:05 ` Alan Stern
2007-11-06 17:51 ` Daniel Drake
2007-11-06 17:54 ` Daniel Drake
2007-11-06 22:18 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47135D33.7080805@gentoo.org \
    --to=dsd@gentoo.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).