linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] sctp: not increase stream's incnt before sending addstrm_in request
@ 2018-11-18 13:59 Xin Long
  2018-11-19 22:47 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Xin Long @ 2018-11-18 13:59 UTC (permalink / raw)
  To: network dev, linux-sctp; +Cc: davem, Marcelo Ricardo Leitner, Neil Horman

Different from processing the addstrm_out request, The receiver handles
an addstrm_in request by sending back an addstrm_out request to the
sender who will increase its stream's in and incnt later.

Now stream->incnt has been increased since it sent out the addstrm_in
request in sctp_send_add_streams(), with the wrong stream->incnt will
even cause crash when copying stream info from the old stream's in to
the new one's in sctp_process_strreset_addstrm_out().

This patch is to fix it by simply removing the stream->incnt change
from sctp_send_add_streams().

Fixes: 242bd2d519d7 ("sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter")
Reported-by: Jianwen Ji <jiji@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/stream.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index ffb940d..3892e76 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -535,7 +535,6 @@ int sctp_send_add_streams(struct sctp_association *asoc,
 		goto out;
 	}
 
-	stream->incnt = incnt;
 	stream->outcnt = outcnt;
 
 	asoc->strreset_outstanding = !!out + !!in;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] sctp: not increase stream's incnt before sending addstrm_in request
  2018-11-18 13:59 [PATCH net] sctp: not increase stream's incnt before sending addstrm_in request Xin Long
@ 2018-11-19 22:47 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-11-19 22:47 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman

From: Xin Long <lucien.xin@gmail.com>
Date: Sun, 18 Nov 2018 21:59:49 +0800

> Different from processing the addstrm_out request, The receiver handles
> an addstrm_in request by sending back an addstrm_out request to the
> sender who will increase its stream's in and incnt later.
> 
> Now stream->incnt has been increased since it sent out the addstrm_in
> request in sctp_send_add_streams(), with the wrong stream->incnt will
> even cause crash when copying stream info from the old stream's in to
> the new one's in sctp_process_strreset_addstrm_out().
> 
> This patch is to fix it by simply removing the stream->incnt change
> from sctp_send_add_streams().
> 
> Fixes: 242bd2d519d7 ("sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter")
> Reported-by: Jianwen Ji <jiji@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-19 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-18 13:59 [PATCH net] sctp: not increase stream's incnt before sending addstrm_in request Xin Long
2018-11-19 22:47 ` David Miller

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).