Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jul 2020 11:15:38 +0200
From:      Jan Behrens <jbe-mlist@magnetkern.de>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        "freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org>
Subject:   Re: USB reset fails when using a LimeSDR Mini on FreeBSD
Message-ID:  <20200702111538.e7edf0ae8d10ec7ede9acebb@magnetkern.de>
In-Reply-To: <e3bd0417-c89c-5598-448e-33ec1e505a3f@selasky.org>
References:  <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <CAM8r67AE1K9AK%2BaL4RCn6_BWajvzKO7K99bYZMdH0mr-HQdyGw@mail.gmail.com> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de> <CAM8r67AF%2BfGiqBr9A0863Za_zR-fG1FxGfNAqEvvafW=wTRmyQ@mail.gmail.com> <20200627144419.f14371695d9b62ea99106c4a@magnetkern.de> <CAM8r67DTKdj0%2BhkOegjBj-ywzWFq2CnS2sQed0mibSUeGp6HSQ@mail.gmail.com> <20200627173604.7f7b7777140e66dbad812fc7@magnetkern.de> <CAM8r67DqZzje=JnrT_R3d6Uo_NxjvGsvpydd1NOTrJHU2jHzQA@mail.gmail.com> <20200627180420.4b8012fb@ernst.home> <20200702103523.adb0566bcc7b6e354905a8a5@magnetkern.de> <97c8fd11-9200-dff7-4c68-b0b80cc44871@selasky.org> <20200702104743.223e98c325806025704703f2@magnetkern.de> <e3bd0417-c89c-5598-448e-33ec1e505a3f@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2 Jul 2020 10:54:27 +0200
Hans Petter Selasky <hps@selasky.org> wrote:

> On 2020-07-02 10:47, Jan Behrens wrote:
> > But wouldn't both drivers require access to the entries in /dev ?
> 
> Yes, user-space drivers would require access to /dev, yes, but kernel 
> drivers not, like mouse, keyboard, storage, network.
> 
> > Thus not every user could mess with any USB device, or do I get it
> > wrong?
> 
> A so-called composite USB device may appear like a USB storage device 
> (kernel driver) and a security token (firefox). Firefox can only grab 
> the device if you set the proper permissions for /dev of course, but the 
> reset device IOCTL then also becomes possible, which is why we currently 
> block it for non-root.
> 
> --HPS

Okay, so if I understand it right, the problem is due to devices that
shall be partly accessible by root, and partly by users. Some device
nodes (e.g. /dev/usb/2.2.1 ) while others (e.g. /dev/usr/2.2.2 ) are
limited to root access only. An USB reset always affects all devices
(e.g. also /dev/usb/2.2.2, 2.2.3, etc.), right?

Disregarding implementation complexity, I'd say that resetting a USB
device should only be possible if a user has access to all sub-devices
(or even better to a special device node that represents the device as
a whole).

That sounds better than adding a sysctl option to me. But I assume that
would require a lot of changes in the code?


Regards,
Jan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200702111538.e7edf0ae8d10ec7ede9acebb>