瀏覽代碼

[NETFILTER]: SCTP conntrack: fix crash triggered by packet without chunks

When a packet without any chunks is received, the newconntrack variable
in sctp_packet contains an out of bounds value that is used to look up an
pointer from the array of timeouts, which is then dereferenced, resulting
in a crash. Make sure at least a single chunk is present.

Problem noticed by George A. Theall <theall@tenablesecurity.com>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 19 年之前
父節點
當前提交
dd7271feba
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      net/ipv4/netfilter/ip_conntrack_proto_sctp.c
  2. 1 1
      net/netfilter/nf_conntrack_proto_sctp.c

+ 1 - 1
net/ipv4/netfilter/ip_conntrack_proto_sctp.c

@@ -254,7 +254,7 @@ static int do_basic_checks(struct ip_conntrack *conntrack,
 	}
 	}
 
 
 	DEBUGP("Basic checks passed\n");
 	DEBUGP("Basic checks passed\n");
-	return 0;
+	return count == 0;
 }
 }
 
 
 static int new_state(enum ip_conntrack_dir dir,
 static int new_state(enum ip_conntrack_dir dir,

+ 1 - 1
net/netfilter/nf_conntrack_proto_sctp.c

@@ -261,7 +261,7 @@ static int do_basic_checks(struct nf_conn *conntrack,
 	}
 	}
 
 
 	DEBUGP("Basic checks passed\n");
 	DEBUGP("Basic checks passed\n");
-	return 0;
+	return count == 0;
 }
 }
 
 
 static int new_state(enum ip_conntrack_dir dir,
 static int new_state(enum ip_conntrack_dir dir,