Skip to content

Commit ca37b80

Browse files
shreeya-patel98PlaidCat
authored andcommitted
sctp: stream: fully roll back denied add-stream state
cve CVE-2026-52929 commit-author Wyatt Feng <bronzed_45_vested@icloud.com> commit a5f8a90 When ADD_OUT_STREAMS is denied, SCTP only shrinks the queued chunks and then lowers outcnt. That leaves removed stream metadata behind, so a later re-add can reuse a stale ext and hit a null-pointer dereference in the scheduler get path. Fix the rollback by tearing down the removed stream state the same way other stream resizes do. Unschedule the current scheduler state, drop the removed stream ext state with sctp_stream_outq_migrate(), and then reschedule the remaining streams. This keeps scheduler-private RR/FC/PRIO lists consistent while fully rolling back denied outgoing stream additions. Fixes: 637784a ("sctp: introduce priority based stream scheduler") Cc: stable@kernel.org Reported-by: Yuan Tan <yuantan098@gmail.com> Reported-by: Yifan Wu <yifanwucs@gmail.com> Reported-by: Juefei Pu <tomapufckgml@gmail.com> Reported-by: Zhengchuan Liang <zcliangcn@gmail.com> Reported-by: Xin Liu <bird@lzu.edu.cn> Signed-off-by: Wyatt Feng <bronzed_45_vested@icloud.com> Signed-off-by: Ren Wei <n05ec@lzu.edu.cn> Acked-by: Xin Long <lucien.xin@gmail.com> Link: https://patch.msgid.link/d78954ecd94954653ee299400e98d74a03a6f7d3.1780603399.git.bronzed_45_vested@icloud.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit a5f8a90) Signed-off-by: Shreeya Patel <spatel@ciq.com>
1 parent de60f28 commit ca37b80

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

net/sctp/stream.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ struct sctp_chunk *sctp_process_strreset_resp(
10381038
stsn, rtsn, GFP_ATOMIC);
10391039
} else if (req->type == SCTP_PARAM_RESET_ADD_OUT_STREAMS) {
10401040
struct sctp_strreset_addstrm *addstrm;
1041+
const struct sctp_sched_ops *sched;
10411042
__u16 number;
10421043

10431044
addstrm = (struct sctp_strreset_addstrm *)req;
@@ -1048,7 +1049,10 @@ struct sctp_chunk *sctp_process_strreset_resp(
10481049
for (i = number; i < stream->outcnt; i++)
10491050
SCTP_SO(stream, i)->state = SCTP_STREAM_OPEN;
10501051
} else {
1051-
sctp_stream_shrink_out(stream, number);
1052+
sched = sctp_sched_ops_from_stream(stream);
1053+
sched->unsched_all(stream);
1054+
sctp_stream_outq_migrate(stream, NULL, number);
1055+
sched->sched_all(stream);
10521056
stream->outcnt = number;
10531057
}
10541058

0 commit comments

Comments
 (0)