OpenCloudOS-Kernel/drivers/net/usb
Emil Goode eb85569fe2 usbnet: remove generic hard_header_len check
This patch removes a generic hard_header_len check from the usbnet
module that is causing dropped packages under certain circumstances
for devices that send rx packets that cross urb boundaries.

One example is the AX88772B which occasionally send rx packets that
cross urb boundaries where the remaining partial packet is sent with
no hardware header. When the buffer with a partial packet is of less
number of octets than the value of hard_header_len the buffer is
discarded by the usbnet module.

With AX88772B this can be reproduced by using ping with a packet
size between 1965-1976.

The bug has been reported here:

https://bugzilla.kernel.org/show_bug.cgi?id=29082

This patch introduces the following changes:
- Removes the generic hard_header_len check in the rx_complete
  function in the usbnet module.
- Introduces a ETH_HLEN check for skbs that are not cloned from
  within a rx_fixup callback.
- For safety a hard_header_len check is added to each rx_fixup
  callback function that could be affected by this change.
  These extra checks could possibly be removed by someone
  who has the hardware to test.
- Removes a call to dev_kfree_skb_any() and instead utilizes the
  dev->done list to queue skbs for cleanup.

The changes place full responsibility on the rx_fixup callback
functions that clone skbs to only pass valid skbs to the
usbnet_skb_return function.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-17 14:35:46 -05:00
..
Kconfig USB2NET: Fix Default to 'y' for SR9800 Device Driver, setting to 'n' 2014-02-13 18:42:01 -05:00
Makefile USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support 2014-02-10 16:53:06 -08:00
asix.h drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
asix_common.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
asix_devices.c net: asix: add missing flag to struct driver_info 2014-02-14 15:47:43 -05:00
ax88172a.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
ax88179_178a.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
catc.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cdc-phonet.c net: cdc-phonet: Staticize usbpn_probe 2013-09-20 14:41:02 -04:00
cdc_eem.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cdc_ether.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cdc_mbim.c net: cdc_mbim: fixup error return value 2013-11-04 15:40:16 -05:00
cdc_ncm.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cdc_subset.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
cx82310_eth.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
dm9601.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-18 00:55:41 -08:00
gl620a.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
hso.c hso: remove some dead code 2014-02-06 21:28:05 -08:00
huawei_cdc_ncm.c net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver 2013-11-05 15:21:25 -05:00
int51x1.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
ipheth.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
kalmia.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
kaweth.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
lg-vl600.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
mcs7830.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
net1080.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
pegasus.c usbnet: pegasus: endian bug in write_mii_word() 2013-05-03 16:10:23 -04:00
pegasus.h drivers: net: usb: pegasus: fix control urb submission 2013-04-29 13:57:50 -04:00
plusb.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
qmi_wwan.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
r815x.c r8152: ecm and vendor modes coexist 2014-01-14 18:48:54 -08:00
r8152.c r8152: fix the submission of the interrupt transfer 2014-02-06 21:18:06 -08:00
rndis_host.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
rtl8150.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
sierra_net.c usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
smsc75xx.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
smsc75xx.h usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
smsc95xx.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
smsc95xx.h usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
sr9700.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
sr9700.h USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support 2013-09-03 22:26:03 -04:00
sr9800.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
sr9800.h USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support 2014-02-10 16:53:06 -08:00
usbnet.c usbnet: remove generic hard_header_len check 2014-02-17 14:35:46 -05:00
zaurus.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00