[cifs-protocol] [EXTERNAL] SMB2 Create replay with multichannel - TrackingID#2105010040000535

Obaid Farooqi obaidf at microsoft.com
Thu May 20 21:13:42 UTC 2021


Hi metze:
I can't do it without traces. Can you please send me traces for this scenario?

Regards,
Obaid Farooqi
Escalation Engineer | Microsoft

-----Original Message-----
From: Obaid Farooqi 
Sent: Wednesday, May 12, 2021 1:37 PM
To: metze <metze at samba.org>
Cc: cifs-protocol at lists.samba.org; Obaid Farooqi <obaidf at microsoftsupport.com>
Subject: RE: [EXTERNAL] SMB2 Create replay with multichannel - TrackingID#2105010040000535

Hi metze:
I am waiting for your traces on this.
I did code browsing to figure out what is going on but I do see the code that is supposed to return file_unavailable. So, traces are needed to figure out what is happening. 

Regards,
Obaid Farooqi
Escalation Engineer | Microsoft

-----Original Message-----
From: Obaid Farooqi 
Sent: Tuesday, May 4, 2021 12:54 AM
To: metze <metze at samba.org>
Cc: cifs-protocol at lists.samba.org; Obaid Farooqi <obaidf at microsoftsupport.com>
Subject: RE: [EXTERNAL] SMB2 Create replay with multichannel - TrackingID#2105010040000535

Hi metze:
Can you please send me the network trace from Windows server side and collect t.cmd traces at the same and upload the network capture and the t*.cab to the following link?
I have uploaded the t.cmd file to the following link in t_cmd.zip.
On the server,
1. open an elevated cmd windows
2. execute the following command:
	>t.cmd srvon
3. start network capture
4. Reproduce the scenario where server send access denied instead of file not available 5. stop the traces by following command
	>t.cmd srvoff
6. save the network capture
7. upload the capture and t*.cab to the following link and let me know.


File Transfer - Case 2105010040000535
https://support.microsoft.com/files?workspace=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ3c2lkIjoiOGVjOWNhMDAtNmY2NS00MzhlLWI4MDgtOGU4ZWUwNTEzNTgxIiwic3IiOiIyMTA1MDEwMDQwMDAwNTM1IiwiYXBwaWQiOiJlNmVlNDNlYi0wZmJjLTQ1NDYtYmM1Mi00YzE2MWZjZGY0YzQiLCJzdiI6InYxIiwicnMiOiJFeHRlcm5hbCIsInd0aWQiOiI5MzI2OTU4MS0xZmYyLTRmYzgtYTIxZi1jOGNjMjIzODFhNWMiLCJpc3MiOiJodHRwczovL2FwaS5kdG1uZWJ1bGEubWljcm9zb2Z0LmNvbSIsImF1ZCI6Imh0dHA6Ly9zbWMiLCJleHAiOjE2Mjc4ODI4ODQsIm5iZiI6MTYyMDEwNjg4NH0.sYW8JsWOFsCmpjbE5teNLeZCFBC16roPkziBE2l_Rw9WIzv_DPctcCdBFEQAYsr_NCASoHETnPPI2QyoWGE0NUvTRMH5sEFIuVqd8dewuoR-VXSaT5TeuSvhuD_JQ-Krpe0SmPeJLGGCB5itaAYLl9uWFMzGQIEpCB25e1mE-u09HpZ809sX5bEqp7AcpS_oJY01r4-O2rfP3yC8ZLZCdwIsF8p5PvEPkgKZ6g37V1lZWr1i-iRtIxsjmt7CYcBi291ANSkogJCgDT9cTAMS4XBlGNefBHRJQkFSqy8sWptCu8qwlAxwLQjwhDkJU___cRPV5LDEaTLuUIrgEiHlNA&wid=8ec9ca00-6f65-438e-b808-8e8ee0513581

username: 2105010040000535_noemail at dtmxfer.onmicrosoft.com

Password: 9 at 7f5(+9

Regards,
Obaid Farooqi
Escalation Engineer | Microsoft

-----Original Message-----
From: Obaid Farooqi
Sent: Monday, May 3, 2021 11:03 AM
To: metze <metze at samba.org>
Cc: cifs-protocol at lists.samba.org; Obaid Farooqi <obaidf at microsoftsupport.com>
Subject: RE: [EXTERNAL] SMB2 Create replay with multichannel - TrackingID#2105010040000535

Hi Metze:
I will help you with this issue and will be in touch as soon as I have an answer.

Regards,
Obaid Farooqi
Escalation Engineer | Microsoft

-----Original Message-----
From: Hung-Chun Yu <HungChun.Yu at microsoft.com>
Sent: Saturday, May 1, 2021 12:52 PM
To: metze <metze at samba.org>
Cc: cifs-protocol at lists.samba.org; Hung-Chun Yu <hunyu at microsoftsupport.com>
Subject: RE: [EXTERNAL] SMB2 Create replay with multichannel - TrackingID#2105010040000535

[BCC dochelp]

Hi Metze

Thank you for contacting Microsoft Open Specifications Support. SR Case 2105010040000535 is created for you. Do leave this tag in the subject line for future tracking.
One of our Engineers will be contacting you shortly.

Hung-Chun Yu
Escalation Engineer
Microsoft Open Specifications

Hung-Chun Yu
Escalation Engineer
Microsoft Open Specifications

-----Original Message-----
From: metze <metze at samba.org>
Sent: Saturday, May 1, 2021 7:15 AM
To: Interoperability Documentation Help <dochelp at microsoft.com>
Cc: cifs-protocol at lists.samba.org
Subject: [EXTERNAL] SMB2 Create replay with multichannel


Hi Dochelp,

I want to clarify unexpected behavior (which is also not documented) of Windows server regarding the replay of SMB2 Create operations.

>From our https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.samba.org%2Fshow_bug.cgi%3Fid%3D14449&data=04%7C01%7Cobaidf%40microsoft.com%7Ca2c9432f09794aa4ed1808d90cc9cf1e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554883173178316%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=q5AIz9w37qN%2FesgqaCe329L7aP8pTEBKlvst9IuaHec%3D&reserved=0:

I think I basically know now how the create replay detection is supposed to work with pending opens.

I found the key hint in this presentation on page 24:https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.snia.org%2Fsites%2Fdefault%2Forig%2FSDC2011%2Fpresentations%2Ftuesday%2FDavidKruseMatthewGeorge_SMB2-2_Bigger_Faster_Scalier_Parts_I_and_II_combined-v1-0.pdf&data=04%7C01%7Cobaidf%40microsoft.com%7Ca2c9432f09794aa4ed1808d90cc9cf1e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554883173178316%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=dgOsQ0Hw5%2FwWAtZjZzn1cGaL5vSs2SeBczVHnLRHe4o%3D&reserved=0
The key point is that the server should return STATUS_FILE_NOT_AVAILABLE as long as the open is still processed and the server detects a channel failure after the client.

The strange thing is that [MS-SMB2] doesn't document this:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fopenspecs%2Fwindows_protocols%2Fms-smb2%2F&data=04%7C01%7Cobaidf%40microsoft.com%7Ca2c9432f09794aa4ed1808d90cc9cf1e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637554883173178316%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=TX8wp44xboQvp8sC62ALSINAAb7wrsVYmJWSHQqdLJ0%3D&reserved=0

My tests against Windows revealed that the server code returns NT_STATUS_ACCESS_DENIED instead of NT_STATUS_FILE_NOT_AVAILABLE.

When SMB2 leases are not used and only oplocks, then the replay is not detected at all and I'm getting NT_STATUS_SHARING_VIOLATION after 35 delay.

However I added test code to disconnect a connection when we get a create without replay flag, then I delay the request by 35 seconds.
During that period I return NT_STATUS_ACCESS_DENIED to the replay attempts from the client in order to simulate the Windows server. The Windows client reports that ACCESS_DENIED to the application (e.g. explorer).

I changed the server code to return NT_STATUS_FILE_NOT_AVAILABLE, in that case the Windows client retries the operation like documented in [MS-SMB2]:

  <152> Section 3.2.5.1: For the following error codes, Windows-based clients will retry the operation
  up to three times and then retry the operation every 5 seconds until the count of milliseconds
  specified by Open.ResilientTimeout is exceeded:

  - STATUS_SERVER_UNAVAILABLE

  - STATUS_FILE_NOT_AVAILABLE

  - STATUS_SHARE_UNAVAILABLE

After 35-40 seconds the client reports the successful retry to the application.
I tested that with "smb2 leases = yes" and "smb2 leases = no", in both cases the client is happy.


Can you please document that behavior and discuss with the product team if this intended or (as I assume) it is just a bug in Windows.

Thanks!
metze




More information about the cifs-protocol mailing list