linux-uconsole/net
Eric Dumazet bc9f0ea1c7 tcp: avoid looping in tcp_send_fin()
[ Upstream commit 845704a535 ]

Presence of an unbound loop in tcp_send_fin() had always been hard
to explain when analyzing crash dumps involving gigantic dying processes
with millions of sockets.

Lets try a different strategy :

In case of memory pressure, try to add the FIN flag to last packet
in write queue, even if packet was already sent. TCP stack will
be able to deliver this FIN after a timeout event. Note that this
FIN being delivered by a retransmit, it also carries a Push flag
given our current implementation.

By checking sk_under_memory_pressure(), we anticipate that cooking
many FIN packets might deplete tcp memory.

In the case we could not allocate a packet, even with __GFP_WAIT
allocation, then not sending a FIN seems quite reasonable if it allows
to get rid of this socket, free memory, and not block the process from
eventually doing other useful work.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 21:56:20 +02:00
..
9p
802
8021q 8021q: fix a potential memory leak 2014-07-28 08:00:04 -07:00
appletalk appletalk: Fix socket referencing in skb 2014-07-28 08:00:05 -07:00
atm
ax25
batman-adv
bluetooth Bluetooth: Avoid use of session socket after the session gets freed 2014-09-17 09:04:00 -07:00
bridge br: fix use of ->rx_handler_data in code executed on non-rx_handler path 2014-11-21 09:22:54 -08:00
caif caif: fix MSG_OOB test in caif_seqpkt_recvmsg() 2015-03-26 15:00:56 +01:00
can can: add missing initialisations in CAN related skbuffs 2015-03-26 15:00:58 +01:00
ceph libceph: fix double __remove_osd() problem 2015-03-06 14:40:54 -08:00
core net: sysctl_net_core: check SNDBUF and RCVBUF for min length 2015-03-26 15:00:55 +01:00
dcb net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-06-26 15:12:37 -04:00
dccp
decnet net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-06-26 15:12:37 -04:00
dns_resolver dns_resolver: Null-terminate the right string 2014-07-28 08:00:06 -07:00
dsa
ethernet
ieee802154
ipv4 tcp: avoid looping in tcp_send_fin() 2015-05-06 21:56:20 +02:00
ipv6 ipv6: Don't reduce hop limit for an interface 2015-04-29 10:33:55 +02:00
ipx ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg 2014-12-06 15:05:47 -08:00
irda net: irda: fix wait_until_sent poll timeout 2015-03-18 13:22:31 +01:00
iucv af_iucv: wrong mapping of sent and confirmed skbs 2014-06-30 20:09:40 -07:00
key
l2tp l2tp: fix race while getting PMTU on PPP pseudo-wire 2014-10-15 08:31:57 +02:00
lapb
llc net: llc: use correct size for sysctl timeout entries 2015-04-19 10:10:50 +02:00
mac80211 mac80211: drop unencrypted frames in mesh fwding 2015-04-13 14:02:11 +02:00
mac802154
netfilter netfilter: conntrack: disable generic tracking for known protocols 2015-04-29 10:33:59 +02:00
netlabel
netlink netlink: Don't reorder loads/stores before marking mmap netlink frame as available 2015-01-27 07:52:30 -08:00
netrom
nfc
openvswitch openvswitch: fix panic with multiple vlan headers 2014-10-15 08:31:57 +02:00
packet packet: handle too big packets for PACKET_V3 2014-10-15 08:31:56 +02:00
phonet net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-06-26 15:12:37 -04:00
rds net: rds: use correct size for max unacked packets and bytes 2015-04-19 10:10:50 +02:00
rfkill
rose
rxrpc rxrpc: bogus MSG_PEEK test in rxrpc_recvmsg() 2015-03-26 15:00:56 +01:00
sched ematch: Fix auto-loading of ematch modules. 2015-03-18 13:22:27 +01:00
sctp net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param 2015-02-26 17:48:49 -08:00
sunrpc sunrpc: fix braino in ->poll() 2015-03-18 13:22:32 +01:00
tipc tipc: clear 'next'-pointer of message fragments before reassembly 2014-07-28 08:00:05 -07:00
unix
vmw_vsock
wimax
wireless nl80211: ignore HT/VHT capabilities without QoS/WMM 2015-04-13 14:02:11 +02:00
x25
xfrm net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-06-26 15:12:37 -04:00
compat.c net: compat: Update get_compat_msghdr() to match copy_msghdr_from_user() behaviour 2015-03-26 15:00:56 +01:00
Kconfig
Makefile
nonet.c
socket.c net: socket: error on a negative msg_namelen 2014-04-14 06:42:16 -07:00
sysctl_net.c