summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-cavium/CVE-2017-5986.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-cavium/CVE-2017-5986.patch')
-rw-r--r--recipes-kernel/linux/linux-cavium/CVE-2017-5986.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-cavium/CVE-2017-5986.patch b/recipes-kernel/linux/linux-cavium/CVE-2017-5986.patch
new file mode 100644
index 0000000..6750cd5
--- /dev/null
+++ b/recipes-kernel/linux/linux-cavium/CVE-2017-5986.patch
@@ -0,0 +1,46 @@
1From 00eff2ebbd229758e90659907724c14dd5a18339 Mon Sep 17 00:00:00 2001
2From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
3Date: Mon, 6 Feb 2017 18:10:31 -0200
4Subject: [PATCH] sctp: avoid BUG_ON on sctp_wait_for_sndbuf
5
6[ Upstream commit 2dcab598484185dea7ec22219c76dcdd59e3cb90 ]
7
8Alexander Popov reported that an application may trigger a BUG_ON in
9sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
10waiting on it to queue more data and meanwhile another thread peels off
11the association being used by the first thread.
12
13This patch replaces the BUG_ON call with a proper error handling. It
14will return -EPIPE to the original sendmsg call, similarly to what would
15have been done if the association wasn't found in the first place.
16
17CVE: CVE-2017-5986
18Upstream-Status: Backport [from kernel.org longterm 4.9.52]
19
20Acked-by: Alexander Popov <alex.popov@linux.com>
21Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
22Reviewed-by: Xin Long <lucien.xin@gmail.com>
23Signed-off-by: David S. Miller <davem@davemloft.net>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
26---
27 net/sctp/socket.c | 3 ++-
28 1 file changed, 2 insertions(+), 1 deletion(-)
29
30diff --git a/net/sctp/socket.c b/net/sctp/socket.c
31index ca12aa3..6cbe5bd 100644
32--- a/net/sctp/socket.c
33+++ b/net/sctp/socket.c
34@@ -7427,7 +7427,8 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
35 */
36 release_sock(sk);
37 current_timeo = schedule_timeout(current_timeo);
38- BUG_ON(sk != asoc->base.sk);
39+ if (sk != asoc->base.sk)
40+ goto do_error;
41 lock_sock(sk);
42
43 *timeo_p = current_timeo;
44--
451.9.1
46