Re: [PATCH net 2/2] sctp: discard stale INIT after handshake completion
Xin Long <[email protected]> Sun, 26 Apr 2026 10:37:27 -0400
| Newsgroups | org.kernel.vger.linux-sctp,org.kernel.vger.netdev |
|---|---|
| Message-ID | <CADvbK_ebPJqKJJNwPXoYj50QtjCSoeE59M6YWYkqk6qBj96vPw@mail.gmail.com> |
> This is an AI-generated review of your patch from:
>
> https://sashiko.dev/#/patchset/cover.1775847557.git.lucien.xin%40gmail.com
>
> > @@ -1556,6 +1556,12 @@ static enum sctp_disposition sctp_sf_do_unexpected_init(
> > /* Tag the variable length parameters. */
> > chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
> >
> > + if (asoc->state >= SCTP_STATE_ESTABLISHED) {
> > + /* Discard INIT matching peer vtag after handshake completion (stale INIT). */
> > + if (chunk->subh.init_hdr->init_tag == asoc->peer.i.init_tag)
> Does this code compare a network-byte-order value directly with a
> host-byte-order value?
> Looking at the structures, chunk->subh.init_hdr->init_tag is a __be32
> extracted directly from the packet, while asoc->peer.i.init_tag is a __u32.
> During handshake initialization, asoc->peer.i.init_tag is populated using
> ntohl().
> On little-endian architectures, will this comparison always fail and allow
> the stale INIT chunks to pass through instead of discarding them?
Will post v2 to fix this.
Thanks.