Re: Do usb_submit_urb() memory allocation errors really exist in the wild?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 26, 2019 at 01:09:30PM +0100, Nicolas Saenz Julienne wrote:
> Hi,
> as I'm sure most of you are aware of, every URB submission triggers a small
> memory allocation in the host controller.

For every host controller driver?  I thought we had some that did not do
that.

> On top of that it might be run in
> atomic context. This has always seemed to me as a possible source of very hard
> to reproduce and potentially nasty issues. For example I'm thinking of embedded
> systems driving some critical operation through USB.

USB and "critical" should never be in the same sentance, without the
word "not" being in there as well. :)

> I wonder if anyone has been able to log any failure on that area. I was unable
> to find anything on the relevant bugzillas, nor by talking with some
> knowledgeable people. Note that some drivers actively protect themselves from
> URB submission failures, taking care to resubmit them (see usbhid/hid-core.c).
> 
> Making the allocation fail on some controlled test system seems feasible (it
> might not be that easy, it really depends on how realistic you want to be). But
> it might be pointless without a real life failure scenario.

We have the memory allocation fault system, try using that to see how
well we recover (or not) from such failures.

Look at how syzbot tested the USB layer, I think they had some
scripts/programs that got kind of deep into the driver layers for this
type of testing.

good luck!

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux