All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: netdev@vger.kernel.org, lksctp-developers@lists.sourceforge.net
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>,
	David Miller <davem@davemloft.net>
Subject: [PATCH] SCTP: Fix kernel panic while received ASCONF chunk with bad serial number
Date: Tue, 05 Feb 2008 23:35:04 +0900	[thread overview]
Message-ID: <47A87418.30206@cn.fujitsu.com> (raw)

While recevied ASCONF chunk with serial number less then needed, kernel 
will treat this chunk as a retransmitted ASCONF chunk and find cached 
ASCONF-ACK chunk used sctp_assoc_lookup_asconf_ack(). But this function 
will always return NO-NULL. So response with cached ASCONF-ACKs chunk 
will cause kernel panic.
In function sctp_assoc_lookup_asconf_ack(), if the cached ASCONF-ACKs 
list asconf_ack_list is empty, or if the serial being requested does not 
exists, the function as it currectly stands returns the actuall 
list_head asoc->asconf_ack_list, this is not a cache ASCONF-ACK chunk 
but a bogus pointer.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

--- a/net/sctp/associola.c	2008-01-28 20:31:39.000000000 -0500
+++ b/net/sctp/associola.c	2008-01-28 23:45:20.000000000 -0500
@@ -1525,7 +1525,7 @@ struct sctp_chunk *sctp_assoc_lookup_asc
 					const struct sctp_association *asoc,
 					__be32 serial)
 {
-	struct sctp_chunk *ack = NULL;
+	struct sctp_chunk *ack;
 
 	/* Walk through the list of cached ASCONF-ACKs and find the
 	 * ack chunk whose serial number matches that of the request.
@@ -1533,9 +1533,9 @@ struct sctp_chunk *sctp_assoc_lookup_asc
 	list_for_each_entry(ack, &asoc->asconf_ack_list, transmitted_list) {
 		if (ack->subh.addip_hdr->serial == serial) {
 			sctp_chunk_hold(ack);
-			break;
+			return ack;
 		}
 	}
 
-	return ack;
+	return NULL;
 }



             reply	other threads:[~2008-02-05 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05 14:35 Wei Yongjun [this message]
2008-02-05 15:00 ` [PATCH] SCTP: Fix kernel panic while received ASCONF chunk with bad serial number Vlad Yasevich

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=47A87418.30206@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=lksctp-developers@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=vladislav.yasevich@hp.com \
    /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.