Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Bjørn Mork
Oliver Neukum writes: > On Thursday 24 January 2013 13:47:40 Bjørn Mork wrote: >> Oliver Neukum writes: >> > On Thursday 24 January 2013 12:22:54 Bjørn Mork wrote: >> > >> >> Sorry for being daft, but how do I code the "20 among the last 30" part >> >> there? >> > >> > Just by agreeing that you

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Oliver Neukum
On Thursday 24 January 2013 13:47:40 Bjørn Mork wrote: > Oliver Neukum writes: > > On Thursday 24 January 2013 12:22:54 Bjørn Mork wrote: > > > >> Sorry for being daft, but how do I code the "20 among the last 30" part > >> there? > > > > Just by agreeing that you can live with false negatives but

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Joe Perches
On Thu, 2013-01-24 at 16:39 +0400, Sergei Shtylyov wrote: > On 24-01-2013 14:25, Bjørn Mork wrote: > > A device sending 0 length frames as fast as it can has been > > observed killing the host system due to the resulting memory > > pressure. [] > > diff --git a/drivers/net/usb/usbnet.c b/drivers/ne

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Bjørn Mork
Oliver Neukum writes: > On Thursday 24 January 2013 12:22:54 Bjørn Mork wrote: > >> Sorry for being daft, but how do I code the "20 among the last 30" part >> there? > > Just by agreeing that you can live with false negatives but not false > positives > > if (++counter > 30) { > counter = b

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Sergei Shtylyov
Hello. On 24-01-2013 14:25, Bjørn Mork wrote: A device sending 0 length frames as fast as it can has been observed killing the host system due to the resulting memory pressure. We handle the done queue as fast as we can, so if this queue is filling up then that is an indication that we are unde

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Oliver Neukum
On Thursday 24 January 2013 12:22:54 Bjørn Mork wrote: > Oliver Neukum writes: > > > On Thursday 24 January 2013 11:52:22 Bjørn Mork wrote: > >> Oliver Neukum writes: > >> > >> > On Thursday 24 January 2013 11:25:52 Bjørn Mork wrote: > >> >> The MBIM firmware for the Sierra Wireless MC7710 is a

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Bjørn Mork
Oliver Neukum writes: > On Thursday 24 January 2013 11:52:22 Bjørn Mork wrote: >> Oliver Neukum writes: >> >> > On Thursday 24 January 2013 11:25:52 Bjørn Mork wrote: >> >> The MBIM firmware for the Sierra Wireless MC7710 is a nice source >> >> of "interesting" device issues. One of the uglier

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Oliver Neukum
On Thursday 24 January 2013 11:52:22 Bjørn Mork wrote: > Oliver Neukum writes: > > > On Thursday 24 January 2013 11:25:52 Bjørn Mork wrote: > >> The MBIM firmware for the Sierra Wireless MC7710 is a nice source > >> of "interesting" device issues. One of the uglier ones is that > >> it under cer

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Bjørn Mork
Oliver Neukum writes: > On Thursday 24 January 2013 11:25:52 Bjørn Mork wrote: >> The MBIM firmware for the Sierra Wireless MC7710 is a nice source >> of "interesting" device issues. One of the uglier ones is that >> it under certain conditions will start flooding us with frames >> having length

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Bjørn Mork
Bjørn Mork writes: > A device sending 0 length frames as fast as it can has been > observed killing the host system due to the resulting memory > pressure. We handle the done queue as fast as we can, so > if this queue is filling up then that is an indication that we > are under too heavy pressur

Re: [RFC] net: usbnet: prevent buggy devices from killing us

2013-01-24 Thread Oliver Neukum
On Thursday 24 January 2013 11:25:52 Bjørn Mork wrote: > The MBIM firmware for the Sierra Wireless MC7710 is a nice source > of "interesting" device issues. One of the uglier ones is that > it under certain conditions will start flooding us with frames > having length 0 as fast as it can. And tha