mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Alan Stern <stern@rowland.harvard.edu>, Oliver Neukum <oneukum@suse.com>
Cc: syzbot <syzbot+23be03b56c5259385d79@syzkaller.appspotmail.com>,
	Thomas Winischhofer <thomas@winischhofer.net>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] WARNING in sisusb_send_bulk_msg/usb_submit_urb
Date: Mon, 3 Apr 2023 16:51:26 +0200	[thread overview]
Message-ID: <97ea1633-3c9e-5042-4edc-8c52f668cc9e@suse.com> (raw)
In-Reply-To: <f396acba-2241-4f62-98ff-ba97ea1a7139@rowland.harvard.edu>



On 03.04.23 16:33, Alan Stern wrote:
> On Mon, Apr 03, 2023 at 10:54:05AM +0200, Oliver Neukum wrote:
>>
>>
>> On 30.03.23 17:34, Alan Stern wrote:

>>   If so, why do we have a generic matching code, although
>> it is always insufficient?
> 
> (I assume you're referring to usb_match_device() and related routines.)
> 
> Not sufficient, perhaps, but necessary.  That is, in addition to
> checking the available endpoints, we also have to make sure the device
> has the right vendor ID, product ID, and so on to match the driver.

The thing is that if we also need to check in each driver, the criteria
for matching devices are not sophisticated and strict enough
> 
>> What is the purpose of a generic binding interface in sysfs if every probe()
>> method blocks it? Allowing a generic probe looks like a misdesign under these
>> circumstances. You'd really want to add IDs to drivers.
> 
> I really don't understand what you're asking.  If you're talking about
> the "bind" and "unbind" files in /sys/bus/*/drivers/*/, they are there

Yes

> to allow manual binding and unbinding of devices.  Even though only one
> driver is likely to bind to any particular device.  (Furthermore, all

They, however, allow binding drivers to arbitrary devices.
Now, you can argue that this will not work. Then I'd say that the correct interface
would be per device, not per driver as it is now and would retrigger
a binding, as if the device were new.
Or you say that if the administrator wants that, well, shoot
yourself into the foot, the driver shall not check.

> this was true even before we started being careful about checking
> endpoints numbers and types.)
> 
> And we _do_ have IDs in drivers; that's what the .id_table member of
> struct usb_driver is for.

Which is not exported through sysfs.
So we export an interface that is not fully usable, not the one people
really want. You almost never want to say that a device at a specific
port is to be bound to a driver at one specific time.
You want to either assign all devices with a new ID to a driver
or unbind and reprobe a device.

	Regards
		Oliver

  reply	other threads:[~2023-04-03 14:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  9:59 [syzbot] Monthly usb report syzbot
2023-03-30 15:34 ` [syzbot] WARNING in sisusb_send_bulk_msg/usb_submit_urb Alan Stern
2023-03-30 16:00   ` [syzbot] [usb?] " syzbot
2023-04-03  8:54   ` [syzbot] " Oliver Neukum
2023-04-03 14:33     ` Alan Stern
2023-04-03 14:51       ` Oliver Neukum [this message]
2023-04-03 15:16         ` Alan Stern
2023-04-10 16:09   ` Alan Stern
2023-04-10 16:31     ` [syzbot] [usb?] " syzbot
2023-03-30 20:10 ` [syzbot] WARNING in shark_write_reg/usb_submit_urb, WARNING in shark_write_val/usb_submit_urb Alan Stern
2023-03-30 20:39   ` [syzbot] [usb?] WARNING in shark_write_reg/usb_submit_urb syzbot
2023-04-01 10:48   ` [syzbot] WARNING in shark_write_reg/usb_submit_urb, WARNING in shark_write_val/usb_submit_urb Hans de Goede
2023-04-01 14:53     ` Greg KH
2023-04-01 18:38       ` Alan Stern
2023-04-05 14:44         ` Greg KH
2023-04-10 16:12   ` [syzbot] WARNING in shark_write_reg/usb_submit_urb Alan Stern
2023-04-10 16:42     ` [syzbot] [usb?] " syzbot

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=97ea1633-3c9e-5042-4edc-8c52f668cc9e@suse.com \
    --to=oneukum@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+23be03b56c5259385d79@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=thomas@winischhofer.net \
    /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

all inboxes | Powered by JetHome®