When an I-FORWARD-TSN skips unordered messages on a stream, sctp_intl_skip() only aborts the stream's unordered partial delivery if the MID being delivered is lower than the skipped MID. If the skipped message is the one being partially delivered, partial delivery stays in progress: no PARTIAL_DELIVERY_ABORTED is sent, and the next unordered message on the stream is delivered as the rest of the abandoned one. Abort the partial delivery when the MID being delivered is at or below the skipped MID, as the ordered case already does. Reproduced on an unmodified kernel with the uo_pd test of the sctp_ifwdtsn.sh selftest added later in this series; its partial delivery checks pass with this fix. Reproduction and fix done with AI assistance. Fixes: de60fe910543 ("sctp: implement handle_ftsn for sctp_stream_interleave") Cc: stable@vger.kernel.org Signed-off-by: Tim Budding --- net/sctp/stream_interleave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c index 840f24045ae2..869940001588 100644 --- a/net/sctp/stream_interleave.c +++ b/net/sctp/stream_interleave.c @@ -1255,7 +1255,7 @@ static void sctp_intl_skip(struct sctp_ulpq *ulpq, __u16 sid, __u32 mid, struct sctp_stream *stream = &ulpq->asoc->stream; if (flags & SCTP_FTSN_U_BIT) { - if (sin->pd_mode_uo && MID_lt(sin->mid_uo, mid)) { + if (sin->pd_mode_uo && !MID_lt(mid, sin->mid_uo)) { sin->pd_mode_uo = 0; sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x1, GFP_ATOMIC); -- 2.34.1