summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wellving <andreas.wellving@enea.com>2018-10-15 10:36:40 +0200
committerAdrian Dudau <Adrian.Dudau@enea.com>2018-10-16 17:40:32 +0200
commit9af805840de789140e83897ce485ada684a44946 (patch)
treeac0f59d2384cc26060ca4965c9e9c40da1d3be6c
parenta706636a8a960796d819bb6471863a894f1943bf (diff)
downloadenea-kernel-cache-9af805840de789140e83897ce485ada684a44946.tar.gz
Cipso: CVE-2018-10938
Cipso: cipso_v4_optptr enter infinite loop References: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=40413955ee265a5e42f710940ec78f5450d49149 Signed-off-by: Andreas Wellving <andreas.wellving@enea.com> Change-Id: I8928fad715f3d323194c3e2021338087ad48042c
-rw-r--r--patches/cve/4.9.x.scc3
-rw-r--r--patches/cve/CVE-2018-10938-Cipso-cipso_v4_optptr-enter-infinite-loop.patch47
2 files changed, 50 insertions, 0 deletions
diff --git a/patches/cve/4.9.x.scc b/patches/cve/4.9.x.scc
index b921809..75f6253 100644
--- a/patches/cve/4.9.x.scc
+++ b/patches/cve/4.9.x.scc
@@ -46,3 +46,6 @@ patch CVE-2018-12233-jfs-Fix-inconsistency-between-memory-allocation-and-.patch
46 46
47#CVEs fixed in 4.9.121: 47#CVEs fixed in 4.9.121:
48patch CVE-2018-9363-Bluetooth-hidp-buffer-overflow-in-hidp_process_repor.patch 48patch CVE-2018-9363-Bluetooth-hidp-buffer-overflow-in-hidp_process_repor.patch
49
50#CVEs fixed in 4.9.125:
51patch CVE-2018-10938-Cipso-cipso_v4_optptr-enter-infinite-loop.patch
diff --git a/patches/cve/CVE-2018-10938-Cipso-cipso_v4_optptr-enter-infinite-loop.patch b/patches/cve/CVE-2018-10938-Cipso-cipso_v4_optptr-enter-infinite-loop.patch
new file mode 100644
index 0000000..68a5d28
--- /dev/null
+++ b/patches/cve/CVE-2018-10938-Cipso-cipso_v4_optptr-enter-infinite-loop.patch
@@ -0,0 +1,47 @@
1From 40413955ee265a5e42f710940ec78f5450d49149 Mon Sep 17 00:00:00 2001
2From: "yujuan.qi" <yujuan.qi@mediatek.com>
3Date: Mon, 31 Jul 2017 11:23:01 +0800
4Subject: [PATCH] Cipso: cipso_v4_optptr enter infinite loop
5
6in for(),if((optlen > 0) && (optptr[1] == 0)), enter infinite loop.
7
8Test: receive a packet which the ip length > 20 and the first byte of ip option is 0, produce this issue
9
10CVE: CVE-2018-10938
11Upstream-Status: Backport
12
13Signed-off-by: yujuan.qi <yujuan.qi@mediatek.com>
14Acked-by: Paul Moore <paul@paul-moore.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
17---
18 net/ipv4/cipso_ipv4.c | 12 ++++++++++--
19 1 file changed, 10 insertions(+), 2 deletions(-)
20
21diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
22index c4c6e19..2ae8f54 100644
23--- a/net/ipv4/cipso_ipv4.c
24+++ b/net/ipv4/cipso_ipv4.c
25@@ -1523,9 +1523,17 @@ unsigned char *cipso_v4_optptr(const struct sk_buff *skb)
26 int taglen;
27
28 for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 0; ) {
29- if (optptr[0] == IPOPT_CIPSO)
30+ switch (optptr[0]) {
31+ case IPOPT_CIPSO:
32 return optptr;
33- taglen = optptr[1];
34+ case IPOPT_END:
35+ return NULL;
36+ case IPOPT_NOOP:
37+ taglen = 1;
38+ break;
39+ default:
40+ taglen = optptr[1];
41+ }
42 optlen -= taglen;
43 optptr += taglen;
44 }
45--
462.7.4
47