Skip to content

Commit

Permalink
sctp: clear the new asoc's stream outcnt in sctp_stream_update
Browse files Browse the repository at this point in the history
When processing a duplicate cookie-echo chunk, sctp moves the new
temp asoc's stream out/in into the old asoc, and later frees this
new temp asoc.

But now after this move, the new temp asoc's stream->outcnt is not
cleared while stream->out is set to NULL, which would cause a same
crash as the one fixed in Commit 79d0895 ("sctp: fix error
path in sctp_stream_init") when freeing this asoc later.

This fix is to clear this outcnt in sctp_stream_update.

Fixes: f952be7 ("sctp: introduce struct sctp_stream_out_ext")
Reported-by: Jianwen Ji <[email protected]>
Signed-off-by: Xin Long <[email protected]>
Acked-by: Neil Horman <[email protected]>
Acked-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
lxin authored and davem330 committed Apr 27, 2018
1 parent 9306b38 commit 6a9a27d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sctp/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ void sctp_stream_update(struct sctp_stream *stream, struct sctp_stream *new)

new->out = NULL;
new->in = NULL;
new->outcnt = 0;
new->incnt = 0;
}

static int sctp_send_reconf(struct sctp_association *asoc,
Expand Down

0 comments on commit 6a9a27d

Please sign in to comment.