summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wellving <andreas.wellving@enea.com>2018-10-12 09:48:18 +0200
committerAdrian Dudau <Adrian.Dudau@enea.com>2018-10-16 17:34:03 +0200
commit5590d516e5d8c7c1066f28e84d91d861e250a42c (patch)
tree32384a5f770e7e559798b9421da54db8db4f3ae0
parentf5798658fff6a3ec63e829612c0c8471d894ebeb (diff)
downloadenea-kernel-cache-5590d516e5d8c7c1066f28e84d91d861e250a42c.tar.gz
dccp: CVE-2018-1130
dccp: check sk for closed state in dccp_sendmsg() References: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67f93df79aeefc3add4e4b31a752600f834236e2 Change-Id: I6e24e1a00265f2fa6fea3f50dd1c4cef92d5b27a Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
-rw-r--r--patches/cve/4.9.x.scc3
-rw-r--r--patches/cve/CVE-2018-1130-dccp-check-sk-for-closed-state-in-dccp_sendmsg.patch44
2 files changed, 47 insertions, 0 deletions
diff --git a/patches/cve/4.9.x.scc b/patches/cve/4.9.x.scc
index d1e56d9..3fa8213 100644
--- a/patches/cve/4.9.x.scc
+++ b/patches/cve/4.9.x.scc
@@ -8,3 +8,6 @@ patch CVE-2018-1068-netfilter-ebtables-CONFIG_COMPAT-don-t-trust-userlan.patch
8 8
9#CVEs fixed in 4.9.89: 9#CVEs fixed in 4.9.89:
10patch CVE-2018-7480-blkcg-fix-double-free-of-new_blkg-in-blkcg_init_queu.patch 10patch CVE-2018-7480-blkcg-fix-double-free-of-new_blkg-in-blkcg_init_queu.patch
11
12#CVEs fixed in 4.9.92:
13patch CVE-2018-1130-dccp-check-sk-for-closed-state-in-dccp_sendmsg.patch
diff --git a/patches/cve/CVE-2018-1130-dccp-check-sk-for-closed-state-in-dccp_sendmsg.patch b/patches/cve/CVE-2018-1130-dccp-check-sk-for-closed-state-in-dccp_sendmsg.patch
new file mode 100644
index 0000000..3af30fc
--- /dev/null
+++ b/patches/cve/CVE-2018-1130-dccp-check-sk-for-closed-state-in-dccp_sendmsg.patch
@@ -0,0 +1,44 @@
1From 67f93df79aeefc3add4e4b31a752600f834236e2 Mon Sep 17 00:00:00 2001
2From: Alexey Kodanev <alexey.kodanev@oracle.com>
3Date: Tue, 6 Mar 2018 22:57:01 +0300
4Subject: [PATCH] dccp: check sk for closed state in dccp_sendmsg()
5
6dccp_disconnect() sets 'dp->dccps_hc_tx_ccid' tx handler to NULL,
7therefore if DCCP socket is disconnected and dccp_sendmsg() is
8called after it, it will cause a NULL pointer dereference in
9dccp_write_xmit().
10
11This crash and the reproducer was reported by syzbot. Looks like
12it is reproduced if commit 69c64866ce07 ("dccp: CVE-2017-8824:
13use-after-free in DCCP code") is applied.
14
15CVE: CVE-2018-1130
16Upstream-Status: Backport
17
18Reported-by: syzbot+f99ab3887ab65d70f816@syzkaller.appspotmail.com
19Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
20Signed-off-by: David S. Miller <davem@davemloft.net>
21Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
22---
23 net/dccp/proto.c | 5 +++++
24 1 file changed, 5 insertions(+)
25
26diff --git a/net/dccp/proto.c b/net/dccp/proto.c
27index 15bdc00..84cd4e3 100644
28--- a/net/dccp/proto.c
29+++ b/net/dccp/proto.c
30@@ -794,6 +794,11 @@ int dccp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
31 if (skb == NULL)
32 goto out_release;
33
34+ if (sk->sk_state == DCCP_CLOSED) {
35+ rc = -ENOTCONN;
36+ goto out_discard;
37+ }
38+
39 skb_reserve(skb, sk->sk_prot->max_header);
40 rc = memcpy_from_msg(skb_put(skb, len), msg, len);
41 if (rc != 0)
42--
43
44