cifs: Fix support for WSL-style symlinks
authorPali Rohár <pali@kernel.org>
Tue, 8 Apr 2025 22:29:49 +0000 (00:29 +0200)
committerSteve French <stfrench@microsoft.com>
Tue, 8 Apr 2025 23:38:03 +0000 (18:38 -0500)
commitc7efac7f1c71470ecd9b1a9a49b1b8164583c7dc
treef4ec74d1676383d9c597364efb13af77643fa09c
parentb365b9d404b7376c60c91cd079218bfef11b7822
cifs: Fix support for WSL-style symlinks

MS-FSCC in section 2.1.2.7 LX SYMLINK REPARSE_DATA_BUFFER now contains
documentation about WSL symlink reparse point buffers.

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/68337353-9153-4ee1-ac6b-419839c3b7ad

Fix the struct reparse_wsl_symlink_data_buffer to reflect buffer fields
according to the MS-FSCC documentation.

Fix the Linux SMB client to correctly fill the WSL symlink reparse point
buffer when creaing new WSL-style symlink. There was a mistake during
filling the data part of the reparse point buffer. It should starts with
bytes "\x02\x00\x00\x00" (which represents version 2) but this constant was
written as number 0x02000000 encoded in little endian, which resulted bytes
"\x00\x00\x00\x02". This change is fixing this mistake.

Fixes: 4e2043be5c14 ("cifs: Add support for creating WSL-style symlinks")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/reparse.c
fs/smb/common/smb2pdu.h