[cifs-protocol] [EXTERNAL] Re: [REG:120063021002364] Clarification on length limit in SMB2_FILE_RENAME_INFORMATION filename
obaidf at microsoft.com
Mon Jul 13 17:18:45 UTC 2020
MS-SMB2 already addresses this issue from the client perspective. Please check out https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/0900604e-b2d0-4fc3-a804-a61515eba43b#Appendix_A_Target_126
: In a SET_INFO request where FileInfoClass is set to FileRenameInformation, and the size of the buffer is less than 24, Windows clients pad the buffer to 24 bytes. These padding bytes are set to arbitrary values. Windows Vista SP1, Windows Server 2008, Windows 7, and Windows Server 2008 R2 clients append up to 4 additional padding bytes set to arbitrary values.
The server side behavior is also documented in 188.8.131.52.1 ( https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/43cf22fe-84cb-49cf-b3e7-e3d7d766a7b7 )
§ If the size of the buffer is less than the size of FILE_RENAME_INFORMATION_TYPE_2 as specified in [MS-FSCC] section 184.108.40.206, the server MUST fail the request with STATUS_INFO_LENGTH_MISMATCH.
The bug I have filed will make the server side behavior more crisp in the way mentioning 24 bytes (although client side already mentions that).
Escalatiion Engineer | Microsoft
From: Jeremy Allison <jra at samba.org>
Sent: Tuesday, July 7, 2020 8:32 PM
To: Obaid Farooqi <obaidf at microsoft.com>
Cc: cifs-protocol at lists.samba.org; slow at samba.org; support <support at mail.support.microsoft.com>
Subject: Re: [EXTERNAL] Re: [REG:120063021002364] Clarification on length limit in SMB2_FILE_RENAME_INFORMATION filename
On Wed, Jul 08, 2020 at 01:02:41AM +0000, Obaid Farooqi wrote:
> Hi Jeremy:
> The size of the rename info in the packet is compared to the sizeof(FILE_RENAME_INFORMATION_TYPE_1). MS-FSCC shows on the wire format (serialized). In code the size of this structure is 24 bytes. In case of one character the size becomes 22 and an error is generated since this is lower than 24. In all other cases i.e. 2 characters or more, the length will be 24 or more.
> I have filed a bug to document this.
Thanks, I expected something like this to be the case.
More information about the cifs-protocol