Re: [PATCH v4 05/11] cifs: Remove the RFC1002 header from smb_hdr

David Howells
2025-11-24T19:56:42Z

Tom Talpey <tom@talpey.com> wrote:

> On 11/24/2025 7:42 AM, David Howells wrote:
> > Remove the RFC1002 header from struct smb_hdr as used for SMB-1.0. This
> > simplifies the SMB-1.0 code by simplifying a lot of places that have to add
> > or subtract 4 to work around the fact that the RFC1002 header isn't really
> > part of the message and the base for various offsets within the message is
> > from the base of the smb_hdr, not the RFC1002 header.
>
> This is truly great, RFC1002 is a framing layer and separating it from
> the upper SMB code is long overdue.
>
> But... isn't this applicable to SMB2/3? The commit log implies it's SMB1
> only (nit there's no such thing as "SMB-1.0"), which is weird given the
> commit applies to many smb2<foo> files.

SMB2/3 doesn't have the RFC1002 headers included in struct smb2_hdr,
presumably because of the compound chaining, so nothing needed doing in that
respect. This harmonises SMB1 with SMB2/3.

> And, are similar changes envisioned in the ksmbd code?

None required AFAIK as that doesn't support SMB1?

David