]> git.baikalelectronics.ru Git - kernel.git/commit
net: usbnet: prevent buggy devices from killing us
authorBjørn Mork <bjorn@mork.no>
Mon, 28 Jan 2013 23:51:28 +0000 (23:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Jan 2013 22:35:44 +0000 (17:35 -0500)
commiteb05374254bc1bf8dac96c130a21d0a88397f52f
tree2c5b72a06bba90a0cfbf4b1ae93c4ba5d41278ef
parent768443aedeefa7064df22ad320d7075f0bb19100
net: usbnet: prevent buggy devices from killing us

A device sending 0 length frames as fast as it can has been
observed killing the host system due to the resulting memory
pressure.

Temporarily disable RX skb allocation and URB submission when
the current error ratio is high, preventing us from trying to
allocate an infinite number of skbs.  Reenable as soon as we
are finished processing the done queue, allowing the device
to continue working after short error bursts.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/usbnet.c
include/linux/usb/usbnet.h