]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: check and update stream->out_curr when allocating stream_out
authorXin Long <lucien.xin@gmail.com>
Sun, 3 Feb 2019 19:27:58 +0000 (03:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Feb 2019 22:27:47 +0000 (14:27 -0800)
commit8f07296435ac1f39ec0833156dce6de0883c5678
tree7d8322b8132c6800108ca87dc965c661e9e3c871
parent4a6d9904c050687a360ce411b376ad53cc058f62
sctp: check and update stream->out_curr when allocating stream_out

Now when using stream reconfig to add out streams, stream->out
will get re-allocated, and all old streams' information will
be copied to the new ones and the old ones will be freed.

So without stream->out_curr updated, next time when trying to
send from stream->out_curr stream, a panic would be caused.

This patch is to check and update stream->out_curr when
allocating stream_out.

v1->v2:
  - define fa_index() to get elem index from stream->out_curr.
v2->v3:
  - repost with no change.

Fixes: d5f9a5945926 ("sctp: introduce stream scheduler foundations")
Reported-by: Ying Xu <yinxu@redhat.com>
Reported-by: syzbot+e33a3a138267ca119c7d@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/stream.c