]> 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)
commitfc0d5b9a36bca099baf550a1a591d03c2f80ffd6
tree2c5b72a06bba90a0cfbf4b1ae93c4ba5d41278ef
parent693c45a855a3fffb09c39014ec7b5af71a2f1f25
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