]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NETFILTER: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr dereference...
authorPatrick McHardy <kaber@trash.net>
Tue, 5 Jun 2007 12:14:22 +0000 (14:14 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Jul 2007 18:08:22 +0000 (11:08 -0700)
When creating a new connection by sending an unknown chunk type, we
don't transition to a valid state, causing a NULL pointer dereference in
sctp_packet when accessing sctp_timeouts[SCTP_CONNTRACK_NONE].

Fix by don't creating new conntrack entry if initial state is invalid.

Noticed by Vilmos Nebehaj <vilmos.nebehaj@ramsys.hu>

CC: Kiran Kumar Immidi <immidi_kiran@yahoo.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/netfilter/nf_conntrack_proto_sctp.c

index 0d3254b974c534d0d3d00244f5ec4ee50ea4f8a7..6e41ba5b03456852f136de9d603e33ef4b3a35b8 100644 (file)
@@ -460,7 +460,8 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,
                                         SCTP_CONNTRACK_NONE, sch->type);
 
                /* Invalid: delete conntrack */
-               if (newconntrack == SCTP_CONNTRACK_MAX) {
+               if (newconntrack == SCTP_CONNTRACK_NONE ||
+                   newconntrack == SCTP_CONNTRACK_MAX) {
                        DEBUGP("nf_conntrack_sctp: invalid new deleting.\n");
                        return 0;
                }