summaryrefslogtreecommitdiffstats
path: root/patches/cve/CVE-2019-11478-tcp-refine-memory-limit-test-in-tcp_fragment.patch
diff options
context:
space:
mode:
authorAndreas Wellving <andreas.wellving@enea.com>2019-07-10 11:20:38 +0200
committerAdrian Stratulat <adrian.stratulat@enea.com>2019-07-12 14:30:09 +0200
commitf095fec9a8e21c24ebdc61341bed46d469bd1384 (patch)
tree2b71c04614e75e8252021fda0e046399e3285125 /patches/cve/CVE-2019-11478-tcp-refine-memory-limit-test-in-tcp_fragment.patch
parent726a4b413d426f2209264501fe0f56c88588988f (diff)
downloadenea-kernel-cache-f095fec9a8e21c24ebdc61341bed46d469bd1384.tar.gz
tcp: CVE-2019-11478
tcp: tcp_fragment() should apply sane memory limits tcp: refine memory limit test in tcp_fragment() References: https://nvd.nist.gov/vuln/detail/CVE-2019-11478 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.9.y&id=e358f4af19db46ca25cc9a8a78412b09ba98859d https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.9.y&id=caa51edc7e9606418611e68de624efbd0042adf5 Change-Id: Ie16affeda488857ce013ce3be578c05619aee446 Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
Diffstat (limited to 'patches/cve/CVE-2019-11478-tcp-refine-memory-limit-test-in-tcp_fragment.patch')
-rw-r--r--patches/cve/CVE-2019-11478-tcp-refine-memory-limit-test-in-tcp_fragment.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/cve/CVE-2019-11478-tcp-refine-memory-limit-test-in-tcp_fragment.patch b/patches/cve/CVE-2019-11478-tcp-refine-memory-limit-test-in-tcp_fragment.patch
new file mode 100644
index 0000000..57bca2c
--- /dev/null
+++ b/patches/cve/CVE-2019-11478-tcp-refine-memory-limit-test-in-tcp_fragment.patch
@@ -0,0 +1,45 @@
1From caa51edc7e9606418611e68de624efbd0042adf5 Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <edumazet@google.com>
3Date: Fri, 21 Jun 2019 06:09:55 -0700
4Subject: [PATCH] tcp: refine memory limit test in tcp_fragment()
5
6commit b6653b3629e5b88202be3c9abc44713973f5c4b4 upstream.
7
8tcp_fragment() might be called for skbs in the write queue.
9
10Memory limits might have been exceeded because tcp_sendmsg() only
11checks limits at full skb (64KB) boundaries.
12
13Therefore, we need to make sure tcp_fragment() wont punish applications
14that might have setup very low SO_SNDBUF values.
15
16CVE: CVE-2019-11478
17Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.9.y&id=caa51edc7e9606418611e68de624efbd0042adf5]
18
19Fixes: f070ef2ac667 ("tcp: tcp_fragment() should apply sane memory limits")
20Signed-off-by: Eric Dumazet <edumazet@google.com>
21Reported-by: Christoph Paasch <cpaasch@apple.com>
22Tested-by: Christoph Paasch <cpaasch@apple.com>
23Signed-off-by: David S. Miller <davem@davemloft.net>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
26---
27 net/ipv4/tcp_output.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
31index d8c6b833f0ce..0c195b0f4216 100644
32--- a/net/ipv4/tcp_output.c
33+++ b/net/ipv4/tcp_output.c
34@@ -1185,7 +1185,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len,
35 if (nsize < 0)
36 nsize = 0;
37
38- if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf)) {
39+ if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf + 0x20000)) {
40 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPWQUEUETOOBIG);
41 return -ENOMEM;
42 }
43--
442.20.1
45