stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Neil Horman <nhorman@tuxdriver.com>,
	Jamie Parsons <Jamie.Parsons@metaswitch.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: [ 14/22] sctp: refactor sctp_outq_teardown to insure proper re-initalization
Date: Tue, 12 Feb 2013 12:36:57 -0800	[thread overview]
Message-ID: <20130212203416.230269489@linuxfoundation.org> (raw)
In-Reply-To: <20130212203413.459836020@linuxfoundation.org>

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Neil Horman <nhorman@tuxdriver.com>

[ Upstream commit 2f94aabd9f6c925d77aecb3ff020f1cc12ed8f86 ]

Jamie Parsons reported a problem recently, in which the re-initalization of an
association (The duplicate init case), resulted in a loss of receive window
space.  He tracked down the root cause to sctp_outq_teardown, which discarded
all the data on an outq during a re-initalization of the corresponding
association, but never reset the outq->outstanding_data field to zero.  I wrote,
and he tested this fix, which does a proper full re-initalization of the outq,
fixing this problem, and hopefully future proofing us from simmilar issues down
the road.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Jamie Parsons <Jamie.Parsons@metaswitch.com>
Tested-by: Jamie Parsons <Jamie.Parsons@metaswitch.com>
CC: Jamie Parsons <Jamie.Parsons@metaswitch.com>
CC: Vlad Yasevich <vyasevich@gmail.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: netdev@vger.kernel.org
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/sctp/outqueue.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -223,7 +223,7 @@ void sctp_outq_init(struct sctp_associat
 
 /* Free the outqueue structure and any related pending chunks.
  */
-void sctp_outq_teardown(struct sctp_outq *q)
+static void __sctp_outq_teardown(struct sctp_outq *q)
 {
 	struct sctp_transport *transport;
 	struct list_head *lchunk, *temp;
@@ -276,8 +276,6 @@ void sctp_outq_teardown(struct sctp_outq
 		sctp_chunk_free(chunk);
 	}
 
-	q->error = 0;
-
 	/* Throw away any leftover control chunks. */
 	list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) {
 		list_del_init(&chunk->list);
@@ -285,11 +283,17 @@ void sctp_outq_teardown(struct sctp_outq
 	}
 }
 
+void sctp_outq_teardown(struct sctp_outq *q)
+{
+	__sctp_outq_teardown(q);
+	sctp_outq_init(q->asoc, q);
+}
+
 /* Free the outqueue structure and any related pending chunks.  */
 void sctp_outq_free(struct sctp_outq *q)
 {
 	/* Throw away leftover chunks. */
-	sctp_outq_teardown(q);
+	__sctp_outq_teardown(q);
 
 	/* If we were kmalloc()'d, free the memory.  */
 	if (q->malloced)



  parent reply	other threads:[~2013-02-12 20:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 20:36 [ 00/22] 3.0.64-stable review Greg Kroah-Hartman
2013-02-12 20:36 ` [ 01/22] rtlwifi: Fix the usage of the wrong variable in usb.c Greg Kroah-Hartman
2013-02-12 20:36 ` [ 02/22] virtio_console: Dont access uninitialized data Greg Kroah-Hartman
2013-02-12 20:36 ` [ 03/22] kernel/resource.c: fix stack overflow in __reserve_region_with_split() Greg Kroah-Hartman
2013-02-12 20:36 ` [ 04/22] mac80211: synchronize scan off/on-channel and PS states Greg Kroah-Hartman
2013-02-12 20:36 ` [ 05/22] net: prevent setting ttl=0 via IP_TTL Greg Kroah-Hartman
2013-02-12 20:36 ` [ 06/22] MAINTAINERS: Stephen Hemminger email change Greg Kroah-Hartman
2013-02-12 20:36 ` [ 07/22] isdn/gigaset: fix zero size border case in debug dump Greg Kroah-Hartman
2013-02-12 20:36 ` [ 08/22] r8169: remove the obsolete and incorrect AMD workaround Greg Kroah-Hartman
2013-02-12 20:36 ` [ 09/22] net: loopback: fix a dst refcounting issue Greg Kroah-Hartman
2013-02-12 20:36 ` [ 10/22] pktgen: correctly handle failures when adding a device Greg Kroah-Hartman
2013-02-12 20:36 ` [ 11/22] ipv6: do not create neighbor entries for local delivery Greg Kroah-Hartman
2013-02-12 20:36 ` [ 12/22] packet: fix leakage of tx_ring memory Greg Kroah-Hartman
2013-02-12 20:36 ` [ 13/22] atm/iphase: rename fregt_t -> ffreg_t Greg Kroah-Hartman
2013-02-12 20:36 ` Greg Kroah-Hartman [this message]
2013-02-12 20:36 ` [ 15/22] net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree Greg Kroah-Hartman
2013-02-12 20:36 ` [ 16/22] net: sctp: sctp_endpoint_free: zero out secret key data Greg Kroah-Hartman
2013-02-12 20:37 ` [ 17/22] tcp: frto should not set snd_cwnd to 0 Greg Kroah-Hartman
2013-02-12 20:37 ` [ 18/22] tcp: fix for zero packets_in_flight was too broad Greg Kroah-Hartman
2013-02-12 20:37 ` [ 19/22] tcp: fix MSG_SENDPAGE_NOTLAST logic Greg Kroah-Hartman
2013-02-12 20:37 ` [ 20/22] bridge: Pull ip header into skb->data before looking into ip header Greg Kroah-Hartman
2013-02-12 20:37 ` [ 21/22] tg3: Avoid null pointer dereference in tg3_interrupt in netconsole mode Greg Kroah-Hartman
2013-02-12 20:37 ` [ 22/22] tg3: Fix crc errors on jumbo frame receive Greg Kroah-Hartman
2013-02-13  8:06 ` [ 00/22] 3.0.64-stable review Satoru Takeuchi
2013-02-13 15:51 ` Shuah Khan

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=20130212203416.230269489@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Jamie.Parsons@metaswitch.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=stable@vger.kernel.org \
    --cc=vyasevich@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).