android_kernel_google_msm/net
Liu Yu 3fd6294100 tcp_cubic: fix the range of delayed_ack
[ Upstream commit 0cda345d1b ]

commit b9f47a3aae (tcp_cubic: limit delayed_ack ratio to prevent
divide error) try to prevent divide error, but there is still a little
chance that delayed_ack can reach zero. In case the param cnt get
negative value, then ratio+cnt would overflow and may happen to be zero.
As a result, min(ratio, ACK_RATIO_LIMIT) will calculate to be zero.

In some old kernels, such as 2.6.32, there is a bug that would
pass negative param, which then ultimately leads to this divide error.

commit 5b35e1e6e9 (tcp: fix tcp_trim_head() to adjust segment count
with skb MSS) fixed the negative param issue. However,
it's safe that we fix the range of delayed_ack as well,
to make sure we do not hit a divide by zero.

Change-Id: I3897a284a654ea5c0519a81e190ccc130f29d1c3
CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Liu Yu <allanyuliu@tencent.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-29 23:12:13 +08:00
..
9p
802 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-04-02 17:53:39 -07:00
8021q Revert "net: maintain namespace isolation between vlan and real device" 2012-05-10 23:03:34 -04:00
appletalk
atm Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ax25 net: add validation for the socket syscall protocol argument 2016-10-29 23:12:11 +08:00
batman-adv Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge 2012-03-11 15:36:34 -07:00
bluetooth bluetooth: Validate socket address length in sco_sock_bind(). 2016-10-29 23:12:11 +08:00
bridge Merge commit 'v3.4-rc6' into android-3.4 2012-05-07 18:20:34 -07:00
caif caif: Fix memory leakage in the chnl_net.c. 2012-04-13 11:01:44 -04:00
can
ceph libceph: isolate kmap() call in write_partial_msg_pages() 2012-03-22 10:47:52 -05:00
core net: guard tcp_set_keepalive() to tcp sockets 2016-10-29 23:12:11 +08:00
dcb
dccp ipv6: add complete rcu protection around np->opt 2016-06-17 02:54:32 +00:00
decnet net: add validation for the socket syscall protocol argument 2016-10-29 23:12:11 +08:00
dns_resolver
dsa
econet Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ethernet Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ieee802154 6lowpan: add missing spin_lock_init() 2012-04-26 05:32:55 -04:00
ipv4 tcp_cubic: fix the range of delayed_ack 2016-10-29 23:12:13 +08:00
ipv6 ipv6: addrconf: validate new MTU before applying it 2016-10-29 23:12:12 +08:00
ipx
irda net: add validation for the socket syscall protocol argument 2016-10-29 23:12:11 +08:00
iucv Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-22 18:15:32 -07:00
key net/key/af_key.c: add missing kfree_skb 2012-04-13 11:01:44 -04:00
l2tp net/l2tp: don't fall back on UDP [get|set]sockopt 2014-07-24 15:36:39 -07:00
lapb Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
llc net: llc: use correct size for sysctl timeout entries 2016-10-29 23:12:10 +08:00
mac80211 ieee80211: Rename VHT cap struct 2013-09-04 12:43:32 -07:00
netfilter netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages 2016-10-29 23:12:11 +08:00
netlabel netlabel: use GFP flags from caller instead of GFP_ATOMIC 2012-03-22 19:29:57 -04:00
netlink netlink: validate addr_len on bind 2013-07-03 10:34:22 -07:00
netrom Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
nfc NFC: Fix the LLCP Tx fragmentation loop 2012-04-11 15:09:33 -04:00
openvswitch openvswitch: checking wrong variable in queue_userspace_packet() 2012-05-13 15:47:34 -04:00
packet Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
phonet phonet: Sort out initiailziation and cleanup code. 2012-04-13 11:01:43 -04:00
rds RDS: use gfp flags from caller in conn_alloc() 2012-03-22 19:29:58 -04:00
rfkill rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down 2012-04-09 13:57:48 -07:00
rose Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-04-02 17:53:39 -07:00
rxrpc
sched net: sched: export an api to enable/disable flow on sch 2013-03-07 15:20:04 -08:00
sctp sctp: check cached dst before using it 2012-05-10 23:15:47 -04:00
sunrpc sunrpc: Fix possibly uninitialized variable warnings 2016-10-29 23:12:09 +08:00
tipc tipc: Optimize setting of immutable payload message header fields 2012-02-29 11:45:35 -05:00
unix af_unix: use freezable blocking calls in read 2013-07-12 14:22:59 -07:00
wanrouter
wimax
wireless cfg80211: add flags to define country IE processing rules 2014-02-10 15:57:17 -08:00
x25
xfrm xfrm: Access the replay notify functions via the registered callbacks 2012-03-22 19:29:58 -04:00
activity_stats.c net: activity_stats: Add statistics for network transmission activity 2012-04-09 13:57:50 -07:00
compat.c net/compat.c,linux/filter.h: share compat_sock_fprog 2014-10-31 19:46:10 -07:00
Kconfig net: Fix CONFIG_RPS option to be turned off 2012-04-09 13:57:51 -07:00
Makefile net: activity_stats: Add statistics for network transmission activity 2012-04-09 13:57:50 -07:00
nonet.c
socket.c net: validate the range we feed to iov_iter_init() in sys_sendto/sys_recvfrom 2016-06-15 06:22:38 +00:00
sysctl_net.c