From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netfilter-devel@lists.netfilter.org, Patrick McHardy <kaber@trash.net>
Subject: [NETFILTER 03/06]: SCTP conntrack: fix infinite loop
Date: Tue, 2 May 2006 22:48:07 +0200 (MEST) [thread overview]
Message-ID: <20060502204807.7610.29463.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20060502204803.7610.72174.sendpatchset@localhost.localdomain>
[NETFILTER]: SCTP conntrack: fix infinite loop
fix infinite loop in the SCTP-netfilter code: check SCTP chunk size to
guarantee progress of for_each_sctp_chunk(). (all other uses of
for_each_sctp_chunk() are preceded by do_basic_checks(), so this fix
should be complete.)
Based on patch from Ingo Molnar <mingo@elte.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit fcf294628012638bc925b2c158c03efea2decb4c
tree 65284c4c81d889853453017627099a0908650c41
parent 6d7b293e330618cbfa6b4e4dd85dc0072ccd8c7c
author Patrick McHardy <kaber@trash.net> Tue, 02 May 2006 21:58:45 +0200
committer Patrick McHardy <kaber@trash.net> Tue, 02 May 2006 21:58:45 +0200
net/ipv4/netfilter/ip_conntrack_proto_sctp.c | 11 +++++++----
net/netfilter/nf_conntrack_proto_sctp.c | 11 +++++++----
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
index 5259abd..0416073 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
@@ -235,12 +235,15 @@ static int do_basic_checks(struct ip_con
flag = 1;
}
- /* Cookie Ack/Echo chunks not the first OR
- Init / Init Ack / Shutdown compl chunks not the only chunks */
- if ((sch->type == SCTP_CID_COOKIE_ACK
+ /*
+ * Cookie Ack/Echo chunks not the first OR
+ * Init / Init Ack / Shutdown compl chunks not the only chunks
+ * OR zero-length.
+ */
+ if (((sch->type == SCTP_CID_COOKIE_ACK
|| sch->type == SCTP_CID_COOKIE_ECHO
|| flag)
- && count !=0 ) {
+ && count !=0) || !sch->length) {
DEBUGP("Basic checks failed\n");
return 1;
}
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 9cccc32..0c6da49 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -240,12 +240,15 @@ static int do_basic_checks(struct nf_con
flag = 1;
}
- /* Cookie Ack/Echo chunks not the first OR
- Init / Init Ack / Shutdown compl chunks not the only chunks */
- if ((sch->type == SCTP_CID_COOKIE_ACK
+ /*
+ * Cookie Ack/Echo chunks not the first OR
+ * Init / Init Ack / Shutdown compl chunks not the only chunks
+ * OR zero-length.
+ */
+ if (((sch->type == SCTP_CID_COOKIE_ACK
|| sch->type == SCTP_CID_COOKIE_ECHO
|| flag)
- && count !=0 ) {
+ && count !=0) || !sch->length) {
DEBUGP("Basic checks failed\n");
return 1;
}
next prev parent reply other threads:[~2006-05-02 20:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-02 20:48 [NETFILTER 00/06]: Netfilter fixes for 2.6.17 Patrick McHardy
2006-05-02 20:48 ` [NETFILTER 01/06]: H.323 helper: fix endless loop caused by invalid TPKT len Patrick McHardy
2006-05-02 20:48 ` [NETFILTER 02/06]: H.323 helper: fix use of uninitialized data Patrick McHardy
2006-05-02 20:48 ` Patrick McHardy [this message]
2006-05-02 20:48 ` [NETFILTER 04/06]: NAT: silence unused variable warnings with CONFIG_XFRM=n Patrick McHardy
2006-05-02 20:48 ` [NETFILTER 05/06]: H.323 helper: Change author's email address Patrick McHardy
2006-05-02 20:48 ` [NETFILTER 06/06]: x_tables: don't use __copy_{from, to}_user on unchecked memory in compat layer Patrick McHardy
2006-05-04 6:21 ` [NETFILTER 00/06]: Netfilter fixes for 2.6.17 David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060502204807.7610.29463.sendpatchset@localhost.localdomain \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.