sctp: stream: clear current stream on stream teardown
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 sctp: stream: clear current stream on stream teardown
From: Yuqi Xu <[email protected]>
out_curr caches the outbound stream currently being dequeued. When the stream table is replaced, the old stream entries and their ext state are freed, so keeping out_curr leaves scheduler state pointing at released stream storage.
Clear out_curr in sctp_stream_free(), where the backing stream entries are torn down. This keeps the cached scheduler state aligned with the lifetime of the stream table for stream updates and any other full stream teardown paths.
--- net/sctp/stream.c | 1 + 1 file changed, 1 insertion(+)
net/sctp/stream.c +1 -0
@@ -186,6 +186,7 @@ void sctp_stream_free(struct sctp_stream *stream)int i; sched->unsched_all (stream); + stream->out_curr =NULL ;for (i =0 ; i < stream->outcnt; i++)sctp_stream_free_ext (stream, i);genradix_free (&stream->out);
Signature · 1 line
2.54.0
Quoted 31 lines · Ren Wei
From: Yuqi Xu <[email protected]>
out_currcaches the outbound stream currently being dequeued. When the stream table is replaced, the old stream entries and their ext state are freed, so keepingout_currleaves scheduler state pointing at released stream storage.Clear
out_currinsctp_stream_free(), where the backing stream entries are torn down. This keeps the cached scheduler state aligned with the lifetime of the stream table for stream updates and any other full stream teardown paths.Fixes 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")Reported-by Yuan Tan <[email protected]>Reported-by Yifan Wu <[email protected]>Reported-by Juefei Pu <[email protected]>Reported-by Zhengchuan Liang <[email protected]>Reported-by Xin Liu <[email protected]>Assisted-by Codex:GPT-5.4Signed-off-by Yuqi Xu <[email protected]>Signed-off-by Ren Wei <[email protected]>--- net/sctp/stream.c | 1 + 1 file changed, 1 insertion(+)net/sctp/stream.c +0
-0
net/sctp/stream.c void sctp_stream_free(struct sctp_stream *stream) · line 192
Quoted 7 lines
net/sctp/stream.c +1
-0@@ -186,6 +186,7 @@ void sctp_stream_free(struct sctp_stream *stream)int i; sched->unsched_all (stream); + stream->out_curr =NULL ;for (i =0 ; i < stream->outcnt; i++)sctp_stream_free_ext (stream, i);genradix_free (&stream->out);
We sincerely apologize for the repeated duplicate postings.
We did not manage the posting state carefully on our side and ended up sending this series multiple times by mistake. This was entirely our fault, and we are sorry for the unnecessary noise and disruption.
Please ignore the extra copies.
Best regards,
Ren Wei