android_kernel_google_msm/net/ipv4
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
..
netfilter Merge commit 'v3.4-rc3' into android-3.4 2012-04-19 14:42:22 -07:00
af_inet.c net: add validation for the socket syscall protocol argument 2016-10-29 23:12:11 +08:00
ah4.c
arp.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
cipso_ipv4.c
datagram.c
devinet.c net: socket ioctl to reset connections matching local address 2012-04-09 13:53:15 -07:00
esp4.c
fib_frontend.c net: core: Support UID-based routing. 2014-07-08 16:55:52 -07:00
fib_lookup.h
fib_rules.c
fib_semantics.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
fib_trie.c ipv4: Do not use dead fib_info entries. 2012-05-10 22:16:32 -04:00
gre.c
icmp.c net: add a sysctl to reflect the fwmark on replies 2014-05-12 22:39:57 -07:00
igmp.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
inet_connection_sock.c net: core: Support UID-based routing. 2014-07-08 16:55:52 -07:00
inet_diag.c udp_diag: implement idiag_get_info for udp/udplite to get queue information 2012-04-25 20:43:01 -04:00
inet_fragment.c
inet_hashtables.c
inet_lro.c
inet_timewait_sock.c
inetpeer.c
ip_forward.c ipv4: try to cache dst_entries which would cause a redirect 2016-10-29 23:12:10 +08:00
ip_fragment.c
ip_gre.c
ip_input.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ip_options.c
ip_output.c net: core: Support UID-based routing. 2014-07-08 16:55:52 -07:00
ip_sockglue.c
ipcomp.c
ipconfig.c
ipip.c
ipmr.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
Kconfig
Makefile sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size 2012-04-09 13:53:15 -07:00
netfilter.c
ping.c net: ping: Return EAFNOSUPPORT when appropriate. 2015-05-20 15:24:04 +09:00
proc.c
protocol.c
raw.c net: core: Support UID-based routing. 2014-07-08 16:55:52 -07:00
route.c ipv4: try to cache dst_entries which would cause a redirect 2016-10-29 23:12:10 +08:00
syncookies.c net: core: Support UID-based routing. 2014-07-08 16:55:52 -07:00
sysctl_net_ipv4.c net: support marking accepting TCP sockets 2014-05-12 22:43:02 -07:00
sysfs_net_ipv4.c sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size 2012-04-09 13:53:15 -07:00
tcp.c net: ipv4: tcp: Get tcpi_count via file_count() not direct access 2015-05-20 15:22:07 +09:00
tcp_bic.c
tcp_cong.c
tcp_cubic.c tcp_cubic: fix the range of delayed_ack 2016-10-29 23:12:13 +08:00
tcp_diag.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: add a sysctl to config the tcp_default_init_rwnd 2014-02-07 15:45:23 -08:00
tcp_ipv4.c tcp: resets are misrouted 2015-05-20 15:22:49 +09:00
tcp_lp.c
tcp_memcontrol.c
tcp_minisocks.c
tcp_output.c tcp: add a sysctl to config the tcp_default_init_rwnd 2014-02-07 15:45:23 -08:00
tcp_probe.c
tcp_scalable.c
tcp_timer.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c udp: fix behavior of wrong checksums 2016-10-29 23:12:10 +08:00
udp_diag.c udp_diag: implement idiag_get_info for udp/udplite to get queue information 2012-04-25 20:43:01 -04:00
udp_impl.h
udplite.c
xfrm4_input.c
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c net: core: Support UID-based routing. 2014-07-08 16:55:52 -07:00
xfrm4_state.c
xfrm4_tunnel.c