[cifs-protocol] SMB2_CREATE pathname "x\..\y.txt" -> STATUS_INVALID_PARAMETER? [120061624003369]

Jeff McCashland jeffm at microsoft.com
Tue Jun 16 23:07:18 UTC 2020


Hi Volker,

You found some interesting code that I did not find documentation for. However, it is necessary to violate the spec in order to hit it, so it isn't something we would document.

Please note:
[FSCC] 
2.1.5 Pathname
2.1.5.1	Dot Directory Names
Except where explicitly permitted, a pathname component that is a dot directory name MUST NOT be sent over the wire.

That being said, Windows Server parses the filename after the check for DFS normalization, and attempts to remove/resolve any "." or ".." references in order to reduce the buffer size. If it finds "\..\", it searches the string before that point for an earlier "\" separator to find the parent directory. In the test you mentioned for "x\..\y.txt", there is no earlier separator. When this routine fails, it returns INVALID_PARAMETER. Note that an open to "x\y\..\z.txt" would not fail this routine (but it is still a violation, so might fail otherwise). 

Please let me know if you have further concerns on this issue. 

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 
Sent: Tuesday, June 16, 2020 10:31 AM
To: Volker.Lendecke at SerNet.DE
Cc: cifs-protocol at lists.samba.org; support <support at mail.support.microsoft.com>
Subject: RE: SMB2_CREATE pathname "x\..\y.txt" -> STATUS_INVALID_PARAMETER? [120061624003369]

[Obaid to BCC]

Hi Volker,

I will look into the question and I'll let you know what I discover. 

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: Obaid Farooqi <obaidf at microsoft.com>
Sent: Tuesday, June 16, 2020 9:24 AM
To: Volker.Lendecke at SerNet.DE
Cc: cifs-protocol at lists.samba.org
Subject: RE: SMB2_CREATE pathname "x\..\y.txt" -> STATUS_INVALID_PARAMETER? [120061624003369]

Hi Volker:
Thanks for contacting Microsoft. I have created a case to track this issue. A member of the open specifications team will be in touch soon.

Regards,
Obaid Farooqi
Escalatiion Engineer | Microsoft

-----Original Message-----
From: Volker Lendecke <Volker.Lendecke at SerNet.DE>
Sent: Tuesday, June 16, 2020 10:03 AM
To: Interoperability Documentation Help <dochelp at microsoft.com>
Cc: cifs-protocol at lists.samba.org
Subject: [EXTERNAL] SMB2_CREATE pathname "x\..\y.txt" -> STATUS_INVALID_PARAMETER?

Hi, Dochelp!

Attached find a trace that I could not explain according to [MS-SMB2] or [MS-FSCC]. I open a file "y.txt" that does exist, see frame 33. I create a directory "x", see frames 42/43. I then try to open "x\..\y.txt" and get a STATUS_INVALID_PARAMETER in frame 55. I could not find ".." to be illegal as part of a path in the docs.

Can you point me in the right direction?

The server is Windows 2012R2 in case that matters.

Thanks,

Volker

--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: 0551-370000-0, mailto:kontakt at sernet.de
Gesch.F.: Dr. Johannes Loxen und Reinhild Jung AG Göttingen: HR-B 2816 - https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.sernet.de%2F&data=02%7C01%7Cjeffm%40microsoft.com%7Ca4b1d1baf20d48e0041808d81211bf33%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637279214717685900&sdata=bIV5CxX%2FK3cdEkeVrGzjsxi5L6DGSzzhHlxifjRGlJI%3D&reserved=0



More information about the cifs-protocol mailing list