Message ID | 51dfb5a4952fb612b3d31e3d0ea62580be398509.1667598261.git.lucien.xin@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 2f201ae14ae0f91dbf1cffea7bb1e29e81d4d108 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | sctp: fix a NULL pointer dereference in sctp_sched_dequeue_common | expand |
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index c99fe3dc19bc..20831079fb09 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -403,6 +403,11 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc, sout = SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream); sout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++; + /* clear out_curr if all frag chunks are pruned */ + if (asoc->stream.out_curr == sout && + list_is_last(&chk->frag_list, &chk->msg->chunks)) + asoc->stream.out_curr = NULL; + msg_len -= chk->skb->truesize + sizeof(struct sctp_chunk); sctp_chunk_free(chk); if (msg_len <= 0)