Re: [PATCH v2 13/14] smb: server: use smb_decompress_alloc_size() in ksmbd_decompress_request()

Namjae Jeon <[email protected]> Thu, 30 Jul 2026 08:21:53 +0900
Newsgroups org.kernel.vger.linux-cifs
Message-ID <CAKYAXd9-DNGr61h9A-npJrT2Dh-G5h=6fnMbqW=5NayTr7ym2Q@mail.gmail.com>
On Sat, Jul 25, 2026 at 10:08=E2=80=AFPM Namjae Jeon <[email protected]=
> wrote:
>
> On Tue, Jul 21, 2026 at 4:50=E2=80=AFAM Enzo Matsumiya <[email protected]=
e> wrote:
> >
> > Use common helper to validate compress header and get decompressed size=
.
> >
> > Signed-off-by: Enzo Matsumiya <[email protected]>
> I can not apply this patch to #ksmbd-for-next-next.
> Can you create this patch based on #ksmbd-for-next-next ?
>
> > -       max_allowed_pdu_size =3D SMB3_MAX_MSGSIZE + conn->vals->max_wri=
te_size;
> > -       if (out_size > max_allowed_pdu_size ||
> > -           out_size > MAX_STREAM_PROT_LEN)
> > +       buf =3D smb_get_msg(conn->request_buf);
> > +       out_size =3D smb_decompress_alloc_size(buf, pdu_size, 0,
> > +                                            SMB3_MAX_MSGSIZE + conn->v=
als->max_write_size,
> > +                                            conn->compress_chained);
> In ksmbd_decompress_request(), the old code rejected decompressed
> messages smaller than sizeof(struct smb2_pdu).  The new helper call
> passes 0 as dmin.
> So you need to pass sizeof(struct smb2_pdu) as dmin :
> out_size =3D smb_decompress_alloc_size(buf, pdu_size,
>                                            sizeof(struct smb2_pdu),
>                                            SMB3_MAX_MSGSIZE +
>                                            conn->vals->max_write_size,
>                                            conn->compress_chained);
>
> Except this, The other server and common patches look good to me. I'll
> leave the client patches to the cifs.ko developers.
If you do not send the v3 patchset by next week, It will be difficult
to merge into the 7.3 kernel.