SMB2: WPTS CreateClose test case fixes

Review Request #2408 - Created Oct. 23, 2019 and updated

Information
Andrew Stormont
illumos-gate
11863, 11864, 11865
Reviewers
general
gdamore, gwr

11863 SMB2 CREATE should validate impersonation level

While we don't use the impersonation level we should be ensuring that the client hasn't passed a bogus value for it:

"If the ImpersonationLevel in the request is not one of the values specified in section 2.2.13, the server SHOULD fail the request with STATUS_BAD_IMPERSONATION_LEVEL."

This impacts the following WPTS test cases:

CreateCloseTestCaseS640
CreateCloseTestCaseS733
CreateCloseTestCaseS179

11864 SMB2 CREATE should reject absolute paths

The SMB2 documentation says we should reject CREATE requests with absolute paths but we don't currently do that:

"If the file name length is greater than zero and the first character is a path separator character, the server MUST fail the request with STATUS_INVALID_PARAMETER."

This impacts the following WPTS test cases:

CreateCloseTestCaseS249
CreateCloseTestCaseS122
CreateCloseTestCaseS443
CreateCloseTestCaseS418
CreateCloseTestCaseS406
CreateCloseTestCaseS379
CreateCloseTestCaseS367
CreateCloseTestCaseS346
CreateCloseTestCaseS331
CreateCloseTestCaseS285
CreateCloseTestCaseS273

11865 SMB2 CREATE should check MxAc create context size

The SMB2 server should fail with STATUS_INVALID_PARAMETER if the size of a MxAc create context is not large enough to hold the optional timestamp value. This is something the WPTS checks for by issuing a bogus CREATE request with a MxAc create context with a size of 4 bytes (the spec says it MUST be either 0 or 8 bytes long):

"The Data in the Buffer field of the SMB2_CREATE_CONTEXT MUST either contain the following structure or be empty (0 bytes in length)."
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/5ea40835-5d40-4e85-977d-13cd745d3af8

This impacts the following WPTS test case:

InvalidCreateRequestStructureSize

Prior to applying the fix the above test cases fail. With the fix applied they now pass.

Andrew Stormont
Andrew Stormont
Gordon Ross
Garrett D'Amore
Andrew Stormont
Andrew Stormont
Andrew Stormont
Andrew Stormont
Gordon Ross
Andrew Stormont
Review request changed

Change Summary:

Add comment about optional CC data.

Diff:

Revision 4 (+37 -3)

Show changes

Gordon Ross
Ship It!
Loading...