[cifs-protocol] Clarification on type of offset fields in SMB2_READ/SMB2_WRITE.

Jeremy Allison jra at samba.org
Sat May 9 00:35:43 UTC 2020


Hi Dochelp,

Currently we're tracking down a really interesting file
corruption bug in Windows and MacOSX and an
interesting question came up.

In MS-SMB2 the descriptions of SMB2 READ
REQUEST and SMB2 WRITE REQUEST say this
about the 8 byte offset field:

"Offset (8 bytes): The offset, in bytes, into the file from which the data MUST be read. If the
read is being executed on a pipe, the Offset MUST be set to 0 by the client and MUST be
ignored by the server."

Does the server treat this field as
signed or unsigned ? The document says
nothing here that I can find (although
maybe I'm looking in the wrong place).

I'm asking as in MS-FSA the algorithms
for "Server Requests a Write" say:

"ByteOffset: The absolute byte offset in the stream where data should be written. ByteOffset
could be negative, which means the write should occur at the end of the stream."

Is this describing the interface between
the SMB2 server and the NT kernel, or
the way the SMB2 server treats the
Offset field coming in from the client
over the wire ?

It would be really interesting to know
the answer to this question !

Thanks,

Jeremy.



More information about the cifs-protocol mailing list