Re: [PATCH net v3 1/2] sctp: distinguish sequence zero from wildcard in reconf lookup

Xin Long <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-sctp
Message-ID <CADvbK_dAyck-AsK-b1JYcbUXdhr7FR4ndQiYfNYkCxsu0F5tEg@mail.gmail.com>
On Fri, Aug 21, 2026 at 5:14 AM Jun Yang <[email protected]> wrote:
>
> Zero is a valid response sequence after strreset_outseq wraps, but
> sctp_chunk_lookup_strreset_param() currently treats it as a wildcard.
>
> Add match_seq so response lookups match zero exactly while the one
> type-only lookup can still ignore the sequence.
>
> Fixes: 50a41591f110 ("sctp: implement receiver-side procedures for the Add Outgoing Streams Request Parameter")
> Cc: [email protected]
> Suggested-by: Simon Horman <[email protected]>
> Signed-off-by: Jun Yang <[email protected]>
> ---
>  net/sctp/stream.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index 34ffe6c..cfca5aa 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -482,7 +482,7 @@ out:
>
>  static struct sctp_paramhdr *sctp_chunk_lookup_strreset_param(
>                         struct sctp_association *asoc, __be32 resp_seq,
> -                       __be16 type)
> +                       __be16 type, bool match_seq)
>  {
>         struct sctp_chunk *chunk = asoc->strreset_chunk;
>         struct sctp_reconf_chunk *hdr;
> @@ -499,7 +499,7 @@ static struct sctp_paramhdr *sctp_chunk_lookup_strreset_param(
>                  */
>                 struct sctp_strreset_tsnreq *req = param.v;
>
> -               if ((!resp_seq || req->request_seq == resp_seq) &&
> +               if ((!match_seq || req->request_seq == resp_seq) &&
>                     (!type || type == req->param_hdr.type))
>                         return param.v;
>         }
> @@ -564,7 +564,7 @@ struct sctp_chunk *sctp_process_strreset_outreq(
>         if (asoc->strreset_chunk) {
>                 if (!sctp_chunk_lookup_strreset_param(
>                                 asoc, outreq->response_seq,
> -                               SCTP_PARAM_RESET_IN_REQUEST)) {
> +                               SCTP_PARAM_RESET_IN_REQUEST, true)) {
>                         /* same process with outstanding isn't 0 */
>                         result = SCTP_STRRESET_ERR_IN_PROGRESS;
>                         goto out;
> @@ -816,7 +816,7 @@ struct sctp_chunk *sctp_process_strreset_addstrm_out(
>
>         if (asoc->strreset_chunk) {
>                 if (!sctp_chunk_lookup_strreset_param(
> -                       asoc, 0, SCTP_PARAM_RESET_ADD_IN_STREAMS)) {
> +                       asoc, 0, SCTP_PARAM_RESET_ADD_IN_STREAMS, false)) {
>                         /* same process with outstanding isn't 0 */
>                         result = SCTP_STRRESET_ERR_IN_PROGRESS;
>                         goto out;
> @@ -927,7 +927,8 @@ struct sctp_chunk *sctp_process_strreset_resp(
>         struct sctp_paramhdr *req;
>         __u32 result;
>
> -       req = sctp_chunk_lookup_strreset_param(asoc, resp->response_seq, 0);
> +       req = sctp_chunk_lookup_strreset_param(asoc, resp->response_seq, 0,
> +                                              true);
>         if (!req)
>                 return NULL;
>
> --
> 2.55.0
>

Acked-by: Xin Long <[email protected]>

The issue reported by Sashiko [1] is mainly a changelog improvement.
It’s not a big deal to me.

[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260821091440.6496-1-junvyyang%40tencent.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.