summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Sarmadi <sona.sarmadi@enea.com>2015-01-27 14:04:11 +0100
committerZhenhua Luo <zhenhua.luo@freescale.com>2015-02-03 10:11:53 +0800
commit5eeeb3ad74b72d904f805bc6e248e93e722b45c4 (patch)
tree7b47e362ffbada459ffc5660e14b25844762359e
parentd063ec68425094eebf2e5d50e8f410456a8f5143 (diff)
downloadmeta-fsl-ppc-5eeeb3ad74b72d904f805bc6e248e93e722b45c4.tar.gz
sctp: CVE-2014-7841
NULL pointer dereference in af->from_addr_param on malformed packet Reference: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-7841 Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-rw-r--r--recipes-kernel/linux/files/sctp-CVE-2014-7841.patch85
-rw-r--r--recipes-kernel/linux/linux-qoriq_3.12.bb1
2 files changed, 86 insertions, 0 deletions
diff --git a/recipes-kernel/linux/files/sctp-CVE-2014-7841.patch b/recipes-kernel/linux/files/sctp-CVE-2014-7841.patch
new file mode 100644
index 0000000..0c4beb3
--- /dev/null
+++ b/recipes-kernel/linux/files/sctp-CVE-2014-7841.patch
@@ -0,0 +1,85 @@
1From 4008f1dbe6fea8114e7f79ed2d238e369dc9138f Mon Sep 17 00:00:00 2001
2From: Daniel Borkmann <dborkman@redhat.com>
3Date: Mon, 10 Nov 2014 17:54:26 +0100
4Subject: [PATCH] net: sctp: fix NULL pointer dereference in
5 af->from_addr_param on malformed packet
6
7[ Upstream commit e40607cbe270a9e8360907cb1e62ddf0736e4864 ]
8
9An SCTP server doing ASCONF will panic on malformed INIT ping-of-death
10in the form of:
11
12 ------------ INIT[PARAM: SET_PRIMARY_IP] ------------>
13
14While the INIT chunk parameter verification dissects through many things
15in order to detect malformed input, it misses to actually check parameters
16inside of parameters. E.g. RFC5061, section 4.2.4 proposes a 'set primary
17IP address' parameter in ASCONF, which has as a subparameter an address
18parameter.
19
20So an attacker may send a parameter type other than SCTP_PARAM_IPV4_ADDRESS
21or SCTP_PARAM_IPV6_ADDRESS, param_type2af() will subsequently return 0
22and thus sctp_get_af_specific() returns NULL, too, which we then happily
23dereference unconditionally through af->from_addr_param().
24
25The trace for the log:
26
27BUG: unable to handle kernel NULL pointer dereference at 0000000000000078
28IP: [<ffffffffa01e9c62>] sctp_process_init+0x492/0x990 [sctp]
29PGD 0
30Oops: 0000 [#1] SMP
31[...]
32Pid: 0, comm: swapper Not tainted 2.6.32-504.el6.x86_64 #1 Bochs Bochs
33RIP: 0010:[<ffffffffa01e9c62>] [<ffffffffa01e9c62>] sctp_process_init+0x492/0x990 [sctp]
34[...]
35Call Trace:
36 <IRQ>
37 [<ffffffffa01f2add>] ? sctp_bind_addr_copy+0x5d/0xe0 [sctp]
38 [<ffffffffa01e1fcb>] sctp_sf_do_5_1B_init+0x21b/0x340 [sctp]
39 [<ffffffffa01e3751>] sctp_do_sm+0x71/0x1210 [sctp]
40 [<ffffffffa01e5c09>] ? sctp_endpoint_lookup_assoc+0xc9/0xf0 [sctp]
41 [<ffffffffa01e61f6>] sctp_endpoint_bh_rcv+0x116/0x230 [sctp]
42 [<ffffffffa01ee986>] sctp_inq_push+0x56/0x80 [sctp]
43 [<ffffffffa01fcc42>] sctp_rcv+0x982/0xa10 [sctp]
44 [<ffffffffa01d5123>] ? ipt_local_in_hook+0x23/0x28 [iptable_filter]
45 [<ffffffff8148bdc9>] ? nf_iterate+0x69/0xb0
46 [<ffffffff81496d10>] ? ip_local_deliver_finish+0x0/0x2d0
47 [<ffffffff8148bf86>] ? nf_hook_slow+0x76/0x120
48 [<ffffffff81496d10>] ? ip_local_deliver_finish+0x0/0x2d0
49[...]
50
51A minimal way to address this is to check for NULL as we do on all
52other such occasions where we know sctp_get_af_specific() could
53possibly return with NULL.
54
55Fix for CVE-2014-7841
56Upstream-Status: Backport
57
58Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT")
59Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
60Cc: Vlad Yasevich <vyasevich@gmail.com>
61Acked-by: Neil Horman <nhorman@tuxdriver.com>
62Signed-off-by: David S. Miller <davem@davemloft.net>
63Signed-off-by: Jiri Slaby <jslaby@suse.cz>
64Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
65---
66 net/sctp/sm_make_chunk.c | 3 +++
67 1 file changed, 3 insertions(+)
68
69diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
70index 1e06f3b..e342387 100644
71--- a/net/sctp/sm_make_chunk.c
72+++ b/net/sctp/sm_make_chunk.c
73@@ -2622,6 +2622,9 @@ do_addr_param:
74 addr_param = param.v + sizeof(sctp_addip_param_t);
75
76 af = sctp_get_af_specific(param_type2af(param.p->type));
77+ if (af == NULL)
78+ break;
79+
80 af->from_addr_param(&addr, addr_param,
81 htons(asoc->peer.port), 0);
82
83--
841.9.1
85
diff --git a/recipes-kernel/linux/linux-qoriq_3.12.bb b/recipes-kernel/linux/linux-qoriq_3.12.bb
index 2cd8ce9..5c67dc3 100644
--- a/recipes-kernel/linux/linux-qoriq_3.12.bb
+++ b/recipes-kernel/linux/linux-qoriq_3.12.bb
@@ -26,6 +26,7 @@ SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;nobranch=1 \
26 file://0001-ALSA-CVE-2014-4652.patch \ 26 file://0001-ALSA-CVE-2014-4652.patch \
27 file://0002-ALSA-CVE-2014-4653.patch \ 27 file://0002-ALSA-CVE-2014-4653.patch \
28 file://sctp-CVE-2014-4667.patch \ 28 file://sctp-CVE-2014-4667.patch \
29 file://sctp-CVE-2014-7841.patch \
29" 30"
30SRCREV = "6619b8b55796cdf0cec04b66a71288edd3057229" 31SRCREV = "6619b8b55796cdf0cec04b66a71288edd3057229"
31 32