Re: [PATCH net-next v5] sctp: auth: discard auth_chunk when skb_clone fails

Xin Long <[email protected]> Wed, 29 Jul 2026 10:43:26 -0400
Newsgroups org.kernel.vger.linux-sctp,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <CADvbK_cAR8qZwA1pAN1Kov+v-Whg_P19VK-Fzpztxc5fiwA+Pg@mail.gmail.com>
On Tue, Jul 28, 2026 at 9:24=E2=80=AFPM Jakub Kicinski <[email protected]> wr=
ote:
>
> On Thu, 23 Jul 2026 14:11:07 +0800 luoqing wrote:
> > From: Qing Luo <[email protected]>
> >
> > When processing AUTH + COOKIE-ECHO packets, if skb_clone() fails
> > due to memory pressure, chunk->auth_chunk is NULL. The original
> > code still sets chunk->auth =3D 1 and continues, leaving the
> > COOKIE-ECHO to be processed without a valid auth_chunk for
> > deferred verification.
> >
> > Discard the AUTH chunk early via pdiscard when skb_clone() fails,
> > so that the receive loop can continue processing remaining chunks
> > in the inqueue instead of stalling the entire packet.
>
> Hi Xin Long, should we apply this or it's no longer worth it after
> 8e04823c120b ?
>
Apply it to net-next.git.

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

So sending patches with wrong in-reply-to doesn't require repost?

Thanks.
> > diff --git a/net/sctp/associola.c b/net/sctp/associola.c
> > index 62d3cc155809..a5f2835dbe0f 100644
> > --- a/net/sctp/associola.c
> > +++ b/net/sctp/associola.c
> > @@ -999,6 +999,10 @@ static void sctp_assoc_bh_rcv(struct work_struct *=
work)
> >                       if (next_hdr->type =3D=3D SCTP_CID_COOKIE_ECHO) {
> >                               chunk->auth_chunk =3D skb_clone(chunk->sk=
b,
> >                                                             GFP_ATOMIC)=
;
> > +                             if (!chunk->auth_chunk) {
> > +                                     chunk->pdiscard =3D 1;
> > +                                     continue;
> > +                             }
> >                               chunk->auth =3D 1;
> >                               continue;
> >                       }
> > diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
> > index dfb1719275db..a15b599b20b7 100644
> > --- a/net/sctp/endpointola.c
> > +++ b/net/sctp/endpointola.c
> > @@ -368,6 +368,10 @@ static void sctp_endpoint_bh_rcv(struct work_struc=
t *work)
> >                       if (next_hdr->type =3D=3D SCTP_CID_COOKIE_ECHO) {
> >                               chunk->auth_chunk =3D skb_clone(chunk->sk=
b,
> >                                                               GFP_ATOMI=
C);
> > +                             if (!chunk->auth_chunk) {
> > +                                     chunk->pdiscard =3D 1;
> > +                                     continue;
> > +                             }
> >                               chunk->auth =3D 1;
> >                               continue;
> >                       }
>