]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.22.1/netfilter-ip-nf-_conntrack_sctp-fix-remotely-triggerable-null-ptr-dereference.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.22.1 / netfilter-ip-nf-_conntrack_sctp-fix-remotely-triggerable-null-ptr-dereference.patch
CommitLineData
a2fd49a0
GKH
1From 8c640bd0c68201dd0d71b78a07bb224973580ad3 Mon Sep 17 00:00:00 2001
2From: Patrick McHardy <kaber@trash.net>
3Date: Tue, 5 Jun 2007 14:14:22 +0200
4Subject: NETFILTER: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr dereference (CVE-2007-2876)
5
6When creating a new connection by sending an unknown chunk type, we
7don't transition to a valid state, causing a NULL pointer dereference in
8sctp_packet when accessing sctp_timeouts[SCTP_CONNTRACK_NONE].
9
10Fix by don't creating new conntrack entry if initial state is invalid.
11
12Noticed by Vilmos Nebehaj <vilmos.nebehaj@ramsys.hu>
13
14CC: Kiran Kumar Immidi <immidi_kiran@yahoo.com>
15Cc: David Miller <davem@davemloft.net>
16Signed-off-by: Patrick McHardy <kaber@trash.net>
17Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18Signed-off-by: Chris Wright <chrisw@sous-sol.org>
19
20---
21 net/netfilter/nf_conntrack_proto_sctp.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24--- a/net/netfilter/nf_conntrack_proto_sctp.c
25+++ b/net/netfilter/nf_conntrack_proto_sctp.c
26@@ -460,7 +460,8 @@ static int sctp_new(struct nf_conn *conn
27 SCTP_CONNTRACK_NONE, sch->type);
28
29 /* Invalid: delete conntrack */
30- if (newconntrack == SCTP_CONNTRACK_MAX) {
31+ if (newconntrack == SCTP_CONNTRACK_NONE ||
32+ newconntrack == SCTP_CONNTRACK_MAX) {
33 DEBUGP("nf_conntrack_sctp: invalid new deleting.\n");
34 return 0;
35 }