android_kernel_samsung_msm8976/include
Eric Dumazet a33afc1b0e tcp: be more careful in tcp_fragment()
[ Upstream commit b617158dc096709d8600c53b6052144d12b89fab ]

Some applications set tiny SO_SNDBUF values and expect
TCP to just work. Recent patches to address CVE-2019-11478
broke them in case of losses, since retransmits might
be prevented.

We should allow these flows to make progress.

This patch allows the first and last skb in retransmit queue
to be split even if memory limits are hit.

It also adds the some room due to the fact that tcp_sendmsg()
and tcp_sendpage() might overshoot sk_wmem_queued by about one full
TSO skb (64KB size). Note this allowance was already present
in stable backports for kernels < 4.15

Note for < 4.15 backports :
 tcp_rtx_queue_tail() will probably look like :

static inline struct sk_buff *tcp_rtx_queue_tail(const struct sock *sk)
{
	struct sk_buff *skb = tcp_send_head(sk);

	return skb ? tcp_write_queue_prev(sk, skb) : tcp_write_queue_tail(sk);
}

Fixes: f070ef2ac667 ("tcp: tcp_fragment() should apply sane memory limits")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrew Prout <aprout@ll.mit.edu>
Tested-by: Andrew Prout <aprout@ll.mit.edu>
Tested-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Tested-by: Michal Kubecek <mkubecek@suse.cz>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Christoph Paasch <cpaasch@apple.com>
Cc: Jonathan Looney <jtl@netflix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 5917ca48053447dac0e13c51ed7d4e2471a1cbc9)

Change-Id: I8541a25d6a10934cc6d59c750b9a70c975f3b8f5
2019-08-15 21:02:46 +02:00
..
acpi
asm-generic asm-generic: Fix local variable shadow in __set_fixmap_offset 2019-07-27 22:08:56 +02:00
clocksource
crypto crypto: authenc - Export key parsing helper function 2019-07-27 21:53:36 +02:00
drm treewide: Fix typo in Documentation/DocBook 2019-07-27 22:10:20 +02:00
dt-bindings
keys KEYS: user: Align the payload buffer 2019-07-27 22:10:23 +02:00
kvm
linux wcnss: Fix buffer overflow in wcnss_prealloc_get 2019-08-04 22:56:49 +02:00
math-emu
media media: v4l: event: Prevent freeing event subscriptions while accessed 2019-07-27 21:51:55 +02:00
memory
misc
net tcp: be more careful in tcp_fragment() 2019-08-15 21:02:46 +02:00
pcmcia
ras
rdma RDMA/core: Fix incorrect structure packing for booleans 2019-07-27 21:43:09 +02:00
rxrpc
scsi scsi: libsas: align sata_device's rps_resp on a cacheline 2019-07-27 21:46:11 +02:00
sdp Import latest Samsung release 2017-04-18 03:43:52 +02:00
soc/qcom qseecom: Add a new smc cmd to check RPMB key provision status 2019-07-27 22:10:55 +02:00
sound lsm: check payload size validity before using it as array index 2019-07-27 22:10:55 +02:00
target target: Avoid mappedlun symlink creation during lun shutdown 2019-07-27 21:44:16 +02:00
trace Revert "lowmemorykiller: adapt to vmpressure" 2019-07-27 22:09:44 +02:00
uapi ipv4: add option to drop gratuitous ARP packets 2019-08-03 00:23:56 +02:00
video
xen Merge remote-tracking branch 'f2fs/linux-3.10.y' into HEAD 2017-04-18 17:02:28 +02:00
Kbuild