linux-uconsole/net
Eric Dumazet 702d673e9e BACKPORT: tcp/dccp: drop SYN packets if accept queue is full
Per listen(fd, backlog) rules, there is really no point accepting a SYN,
sending a SYNACK, and dropping the following ACK packet if accept queue
is full, because application is not draining accept queue fast enough.

This behavior is fooling TCP clients that believe they established a
flow, while there is nothing at server side. They might then send about
10 MSS (if using IW10) that will be dropped anyway while server is under
stress.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5ea8ea2cb7)

Backport for pass Android CTS CtsLibcoreTestCases:
libcore.javax.net.ServerSocketFactoryTest#testCreateServerSocketWithPortNoBacklog

Refer the comments on libcore/luni/src/test/java/libcore/javax/net/ServerSocketFactoryTest.java
// This test may fail on kernel versions between 4.4 and 4.9, due to a kernel implementation
// detail change. Backporting the following kernel change will fix the behavior.
// http://b/31960002
// https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5ea8ea2cb7f1d0db15762c9b0bb9e7330425a071
public void testCreateServerSocketWithPortNoBacklog() throws IOException {
    ServerSocket serverSocket = ServerSocketFactory.getDefault().createServerSocket(0, 1);
    testSocket(serverSocket, 1);
}

Change-Id: I9bb3531480f4942447d8d4eded110aa31bc7c031
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-21 10:42:52 +08:00
..
6lowpan
9p net/9p: Switch to wait_event_killable() 2017-11-30 08:37:25 +00:00
802
8021q vlan: fix a use-after-free in vlan_device_event() 2017-11-24 08:32:24 +01:00
appletalk
atm
ax25 ax25: Fix segfault after sock connection timeout 2017-02-04 09:45:09 +01:00
batman-adv batman-adv: Check for alloc errors when preparing TT local data 2016-12-15 08:49:23 -08:00
bluetooth Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-09-14 12:01:21 +08:00
bridge Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-10-09 14:32:35 +08:00
caif net: caif: Fix a sleep-in-atomic bug in cfpkt_create_pfx 2017-07-05 14:37:14 +02:00
can can: Fix kernel panic at security_sock_rcv_skb 2017-02-18 16:39:26 +01:00
ceph libceph: force GFP_NOIO for socket allocations 2017-04-08 09:53:30 +02:00
core Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-11-26 12:03:21 +08:00
dcb
dccp BACKPORT: tcp/dccp: drop SYN packets if accept queue is full 2017-12-21 10:42:52 +08:00
decnet decnet: always not take dst->__refcnt when inserting dst into hash table 2017-07-05 14:37:14 +02:00
dns_resolver KEYS: Fix race between updating and finding a negative key 2017-10-27 10:23:18 +02:00
dsa net: dsa: select NET_SWITCHDEV 2017-11-15 17:13:11 +01:00
ethernet net: introduce device min_header_len 2017-02-18 16:39:27 +01:00
hsr
ieee802154 Revert "net: fix percpu memory leaks" 2017-09-27 11:00:11 +02:00
ipv4 BACKPORT: tcp/dccp: drop SYN packets if accept queue is full 2017-12-21 10:42:52 +08:00
ipv6 Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git 2017-12-01 11:04:13 +08:00
ipx ipx: call ipxitf_put() in ioctl error path 2017-05-25 14:30:13 +02:00
irda irda: do not leak initialized list.dev to userspace 2017-08-30 10:19:21 +02:00
iucv af_iucv: Validate socket address length in iucv_sock_bind() 2016-03-03 15:07:03 -08:00
key af_key: do not use GFP_KERNEL in atomic contexts 2017-08-30 10:19:18 +02:00
l2tp Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-11-20 20:53:19 +05:30
l3mdev
lapb
llc net/llc: avoid BUG_ON() in skb_orphan() 2017-02-26 11:07:49 +01:00
mac80211 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-12-01 01:02:04 +08:00
mac802154
mpls mpls: Send route delete notifications when router module is unloaded 2017-03-22 12:04:16 +01:00
netfilter Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-12-01 01:02:04 +08:00
netlabel netlabel: add address family checks to netlbl_{sock,req}_delattr() 2016-08-20 18:09:22 +02:00
netlink af_netlink: ensure that NLMSG_DONE never fails in dumps 2017-11-24 08:32:24 +01:00
netrom
nfc Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-12-01 01:02:04 +08:00
openvswitch openvswitch: fix potential out of bound access in parse_ct 2017-08-11 09:08:53 -07:00
packet packet: avoid panic in packet_getsockopt() 2017-11-18 11:11:06 +01:00
phonet
rds RDS: RDMA: return appropriate error on rdma map failures 2017-11-30 08:37:25 +00:00
rfkill net: rfkill: fixes the warning with gcc-7.2 build 2017-12-14 10:06:09 +08:00
rose
rxrpc rxrpc: Fix several cases where a padded len isn't checked in ticket decode 2017-06-29 12:48:52 +02:00
sched net: sched: fix NULL pointer dereference when action calls some targets 2017-08-30 10:19:21 +02:00
sctp Revert "sctp: do not peel off an assoc from one netns to another one" 2017-11-30 08:37:28 +00:00
sunrpc SUNRPC: fix refcounting problems with auth_gss messages. 2017-04-21 09:30:08 +02:00
switchdev switchdev: pass pointer to fib_info instead of copy 2016-06-24 10:18:16 -07:00
tipc tipc: fix link attribute propagation bug 2017-11-18 11:11:07 +01:00
unix net/unix: don't show information about sockets from other namespaces 2017-11-18 11:11:06 +01:00
vmw_vsock vsock: use new wait API for vsock_stream_sendmsg() 2017-11-30 08:37:19 +00:00
wimax
wireless Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-11-20 20:53:19 +05:30
x25 net: fix a kernel infoleak in x25 module 2016-05-18 17:06:43 -07:00
xfrm BACKPORT: xfrm: Clear sk_dst_cache when applying per-socket policy. 2017-11-20 21:15:59 +05:30
compat.c audit: log 32-bit socketcalls 2017-10-08 10:14:18 +02:00
Kconfig Revert "net: activity_stats: Add statistics for network transmission activity" 2016-05-19 12:32:41 +05:30
Makefile Revert "net: activity_stats: Add statistics for network transmission activity" 2016-05-19 12:32:41 +05:30
socket.c UPSTREAM: net: socket: Make unnecessarily global sockfs_setattr() static 2017-05-01 15:05:07 +05:30
sysctl_net.c net: Use ns_capable_noaudit() when determining net sysctl permissions 2016-09-15 08:27:50 +02:00