Skip to content

Commit 99d24ed

Browse files
kaberdavem330
authored andcommitted
[NETFILTER]: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr dereference (CVE-2007-2876)
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> 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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 56b3d97 commit 99d24ed

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎net/netfilter/nf_conntrack_proto_sctp.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,
431431
SCTP_CONNTRACK_NONE, sch->type);
432432

433433
/* Invalid: delete conntrack */
434-
if (newconntrack == SCTP_CONNTRACK_MAX) {
434+
if (newconntrack == SCTP_CONNTRACK_NONE ||
435+
newconntrack == SCTP_CONNTRACK_MAX) {
435436
pr_debug("nf_conntrack_sctp: invalid new deleting.\n");
436437
return 0;
437438
}

0 commit comments

Comments
 (0)