kernel_optimize_test/drivers/net/usb
hayeswang 7937f9e514 r8152: fix tx/rx memory overflow
The tx/rx would access the memory which is out of the desired range.
Modify the method of checking the end of the memory to avoid it.

For r8152_tx_agg_fill(), the variable remain may become negative.
However, the declaration is unsigned, so the while loop wouldn't
break when reaching the end of the desied memory. Although to change
the declaration from unsigned to signed is enough to fix it, I also
modify the checking method for safe. Replace

		remain = rx_buf_sz - sizeof(*tx_desc) -
			 (u32)((void *)tx_data - agg->head);

with

		remain = rx_buf_sz - (int)(tx_agg_align(tx_data) - agg->head);

to make sure the variable remain is always positive. Then, the
overflow wouldn't happen.

For rx_bottom(), the rx_desc should not be used to calculate the
packet length before making sure the rx_desc is in the desired range.
Change the checking to two parts. First, check the descriptor is in
the memory. The other, using the descriptor to find out the packet
length and check if the packet is in the memory.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-11-20 15:09:41 -05:00
..
asix_common.c asix: fix BUG in receive path when lowering MTU 2013-05-03 16:10:33 -04:00
asix_devices.c net: asix: Move declaration of ax88172a_info to shared header 2013-08-13 14:13:52 -07:00
asix.h net: asix: Move declaration of ax88172a_info to shared header 2013-08-13 14:13:52 -07:00
ax88172a.c net: asix: Staticise non-exported symbols 2013-08-13 14:13:52 -07:00
ax88179_178a.c ax88179_178a: Remove AX_MEDIUM_ALWAYS_ONE bit in AX_MEDIUM_STATUS_MODE register to avoid TX throttling 2013-10-25 19:26:59 -04:00
catc.c net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
cdc_eem.c
cdc_ether.c net: usb: cdc_ether: use usb.h macros whenever possible 2013-09-16 21:38:00 -04:00
cdc_mbim.c net: cdc_mbim: fixup error return value 2013-11-04 15:40:16 -05:00
cdc_ncm.c net: cdc_ncm: cleanup a type issue in cdc_ncm_setup() 2013-11-14 03:10:30 -05:00
cdc_subset.c
cdc-phonet.c net: cdc-phonet: Staticize usbpn_probe 2013-09-20 14:41:02 -04:00
cx82310_eth.c
dm9601.c dm9601: fix IFF_ALLMULTI handling 2013-09-30 19:48:59 -04:00
gl620a.c
hso.c hso: Fix stack corruption on some architectures 2013-08-21 20:47:59 -07: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
ipheth.c net: ipheth: Add USB ID for iPad mini 2013-07-02 00:32:56 -07:00
kalmia.c net/usb/kalmia: use %*phC to dump small buffers 2013-05-29 00:35:20 -07:00
kaweth.c
Kconfig net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver 2013-11-05 15:21:25 -05:00
lg-vl600.c
Makefile net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver 2013-11-05 15:21:25 -05:00
mcs7830.c
net1080.c
pegasus.c
pegasus.h
plusb.c
qmi_wwan.c net: qmi_wwan: no need to check for resume if suspend exists 2013-11-04 15:40:16 -05:00
r815x.c net/usb/r815x: change the return value for bind functions 2013-07-31 14:49:13 -07:00
r8152.c r8152: fix tx/rx memory overflow 2013-11-20 15:09:41 -05:00
rndis_host.c
rtl8150.c drivers: net: usb: rtl8150: concurrent URB bugfix 2013-05-20 13:42:05 -07:00
sierra_net.c sierra_net: keep status interrupt URB active 2013-05-08 13:13:29 -07:00
smsc75xx.c usbnet: do not pretend to support SG/TSO 2013-07-26 13:48:22 -07:00
smsc75xx.h
smsc95xx.c
smsc95xx.h
sr9700.c USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support 2013-09-03 22:26:03 -04:00
sr9700.h USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support 2013-09-03 22:26:03 -04:00
usbnet.c usbnet: fix status interrupt urb handling 2013-11-14 02:32:37 -05:00
zaurus.c