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

Jeff McCashland jeffm at microsoft.com
Mon May 11 19:01:19 UTC 2020


Hi Jeremy,

[MS-FSA] describes the operation of the underlying file store, roughly how NTFS works. NTFS will accept negative Offset writes and treat them as documented in [MS-FSA]. However, SMB2 will return STATUS_INVALID_PARAMETER if SMB2_READ or SMB2_WRITE Offset are < 0. SMB2 will not send a Write request to the underlying file store with a negative Offset. 

I hope that helps!

Best regards,
Jeff McCashland | Senior Escalation Engineer | Microsoft Protocol Open Specifications Team 
Phone: +1 (425) 703-8300 x38300 | Hours: 9am-5pm | Time zone: (UTC-08:00) Pacific Time (US and Canada)
Local country phone number found here: http://support.microsoft.com/globalenglish | Extension 1138300
We value your feedback.  My manager is Jeremy Chapman (jeremyc), +1 (469) 775-2475

-----Original Message-----
From: Jeff McCashland <jeffm at microsoft.com> 
Sent: Friday, May 8, 2020 5:55 PM
To: Jeremy Allison <jra at samba.org>; cifs-protocol <cifs-protocol at lists.samba.org>; Stefan Metzmacher <metze at samba.org>
Cc: support <support at mail.support.microsoft.com>
Subject: [REG:120050921000038] Clarification on type of offset fields in SMB2_READ/SMB2_WRITE.

[DocHelp to BCC, support on CC, SR ID on Subject]

Hi Jeremy,

Thank you for your question. We have created SR 120050921000038 to track this issue. I will research the question and let you know what I find.

Best regards,
Jeff McCashland | Senior Escalation Engineer | Microsoft Protocol Open Specifications Team
Phone: +1 (425) 703-8300 x38300 | Hours: 9am-5pm | Time zone: (UTC-08:00) Pacific Time (US and Canada) Local country phone number found here: https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsupport.microsoft.com%2Fglobalenglish&data=02%7C01%7Cjeffm%40microsoft.com%7C1afc7db23c3c45ab4c2c08d7f3b3b354%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637245825444488457&sdata=fxzgcguyEb7UL9m3sqS08IPMvv0pPzAgCs2PACDK2Ng%3D&reserved=0 | Extension 1138300 We value your feedback.  My manager is Jeremy Chapman (jeremyc), +1 (469) 775-2475

-----Original Message-----
From: Jeremy Allison <jra at samba.org>
Sent: Friday, May 8, 2020 5:36 PM
To: cifs-protocol <cifs-protocol at lists.samba.org>; Interoperability Documentation Help <dochelp at microsoft.com>; Stefan Metzmacher <metze at samba.org>; jra at samba.org
Subject: [EXTERNAL] Clarification on type of offset fields in SMB2_READ/SMB2_WRITE.

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