<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/smb/client/reparse.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-08-15T10:17:05Z</updated>
<entry>
<title>smb: client: set symlink type as native for POSIX mounts</title>
<updated>2025-08-15T10:17:05Z</updated>
<author>
<name>Paulo Alcantara</name>
</author>
<published>2025-07-31T23:46:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1146090066409498a8fa1d8bd8c3f4089d6d59b'/>
<id>urn:sha1:c1146090066409498a8fa1d8bd8c3f4089d6d59b</id>
<content type='text'>
commit a967e758f8e9d8ce5ef096743393df5e6e51644b upstream.

SMB3.1.1 POSIX mounts require symlinks to be created natively with
IO_REPARSE_TAG_SYMLINK reparse point.

Cc: linux-cifs@vger.kernel.org
Cc: Ralph Boehme &lt;slow@samba.org&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Matthew Richardson &lt;m.richardson@ed.ac.uk&gt;
Closes: https://marc.info/?i=1124e7cd-6a46-40a6-9f44-b7664a66654b@ed.ac.uk
Signed-off-by: Paulo Alcantara (Red Hat) &lt;pc@manguebit.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>smb: client: fix native SMB symlink traversal</title>
<updated>2025-07-10T14:08:46Z</updated>
<author>
<name>Paulo Alcantara</name>
</author>
<published>2025-07-03T20:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6ea7b6c6be65149ab6b8e37a9dd1671f76add1b'/>
<id>urn:sha1:b6ea7b6c6be65149ab6b8e37a9dd1671f76add1b</id>
<content type='text'>
[ Upstream commit 3363da82e02f1bddc54faa92ea430c6532e2cd2e ]

We've seen customers having shares mounted in paths like /??/C:/ or
/??/UNC/foo.example.com/share in order to get their native SMB
symlinks successfully followed from different mounts.

After commit 12b466eb52d9 ("cifs: Fix creating and resolving absolute NT-style symlinks"),
the client would then convert absolute paths from "/??/C:/" to "/mnt/c/"
by default.  The absolute paths would vary depending on the value of
symlinkroot= mount option.

Fix this by restoring old behavior of not trying to convert absolute
paths by default.  Only do this if symlinkroot= was _explicitly_ set.

Before patch:

  $ mount.cifs //w22-fs0/test2 /mnt/1 -o vers=3.1.1,username=xxx,password=yyy
  $ ls -l /mnt/1/symlink2
  lrwxr-xr-x 1 root root 15 Jun 20 14:22 /mnt/1/symlink2 -&gt; /mnt/c/testfile
  $ mkdir -p /??/C:; echo foo &gt; //??/C:/testfile
  $ cat /mnt/1/symlink2
  cat: /mnt/1/symlink2: No such file or directory

After patch:

  $ mount.cifs //w22-fs0/test2 /mnt/1 -o vers=3.1.1,username=xxx,password=yyy
  $ ls -l /mnt/1/symlink2
  lrwxr-xr-x 1 root root 15 Jun 20 14:22 /mnt/1/symlink2 -&gt; '/??/C:/testfile'
  $ mkdir -p /??/C:; echo foo &gt; //??/C:/testfile
  $ cat /mnt/1/symlink2
  foo

Cc: linux-cifs@vger.kernel.org
Reported-by: Pierguido Lambri &lt;plambri@redhat.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Stefan Metzmacher &lt;metze@samba.org&gt;
Fixes: 12b466eb52d9 ("cifs: Fix creating and resolving absolute NT-style symlinks")
Signed-off-by: Paulo Alcantara (Red Hat) &lt;pc@manguebit.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>smb: client: fix regression with native SMB symlinks</title>
<updated>2025-07-06T09:04:12Z</updated>
<author>
<name>Paulo Alcantara</name>
</author>
<published>2025-06-22T17:13:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ddaf7567080c7de2e0c99efca2ee1e6b79beea5'/>
<id>urn:sha1:6ddaf7567080c7de2e0c99efca2ee1e6b79beea5</id>
<content type='text'>
commit ff8abbd248c1f52df0c321690b88454b13ff54b2 upstream.

Some users and customers reported that their backup/copy tools started
to fail when the directory being copied contained symlink targets that
the client couldn't parse - even when those symlinks weren't followed.

Fix this by allowing lstat(2) and readlink(2) to succeed even when the
client can't resolve the symlink target, restoring old behavior.

Cc: linux-cifs@vger.kernel.org
Cc: stable@vger.kernel.org
Reported-by: Remy Monsen &lt;monsen@monsen.cc&gt;
Closes: https://lore.kernel.org/r/CAN+tdP7y=jqw3pBndZAGjQv0ObFq8Q=+PUDHgB36HdEz9QA6FQ@mail.gmail.com
Reported-by: Pierguido Lambri &lt;plambri@redhat.com&gt;
Fixes: 12b466eb52d9 ("cifs: Fix creating and resolving absolute NT-style symlinks")
Signed-off-by: Paulo Alcantara (Red Hat) &lt;pc@manguebit.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cifs: Remove duplicate fattr-&gt;cf_dtype assignment from wsl_to_fattr() function</title>
<updated>2025-06-27T10:13:43Z</updated>
<author>
<name>Pali Rohár</name>
</author>
<published>2025-06-08T14:10:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fde255cc76ed3ec4b58e409cf545342e25366a6c'/>
<id>urn:sha1:fde255cc76ed3ec4b58e409cf545342e25366a6c</id>
<content type='text'>
[ Upstream commit 840738eae94864993a735ab677b9795bb8f3b961 ]

Commit 8bd25b61c5a5 ("smb: client: set correct d_type for reparse DFS/DFSR
and mount point") deduplicated assignment of fattr-&gt;cf_dtype member from
all places to end of the function cifs_reparse_point_to_fattr(). The only
one missing place which was not deduplicated is wsl_to_fattr(). Fix it.

Fixes: 8bd25b61c5a5 ("smb: client: set correct d_type for reparse DFS/DFSR and mount point")
Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cifs: Split parse_reparse_point callback to functions: get buffer and parse buffer</title>
<updated>2025-04-09T20:37:35Z</updated>
<author>
<name>Pali Rohár</name>
</author>
<published>2024-10-14T13:00:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56c0bea52cef0bb02c4d6c23669ef485b5f67c87'/>
<id>urn:sha1:56c0bea52cef0bb02c4d6c23669ef485b5f67c87</id>
<content type='text'>
Parsing reparse point buffer is generic for all SMB versions and is already
implemented by global function parse_reparse_point().

Getting reparse point buffer from the SMB response is SMB version specific,
so introduce for it a new callback get_reparse_point_buffer.

This functionality split is needed for followup change - getting reparse
point buffer without parsing it.

Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: Improve handling of name surrogate reparse points in reparse.c</title>
<updated>2025-04-09T20:37:26Z</updated>
<author>
<name>Pali Rohár</name>
</author>
<published>2024-10-03T19:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12193b9801e7559745a7a3202d3d3c9265905461'/>
<id>urn:sha1:12193b9801e7559745a7a3202d3d3c9265905461</id>
<content type='text'>
Like previous changes for file inode.c, handle directory name surrogate
reparse points generally also in reparse.c.

Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: Fix support for WSL-style symlinks</title>
<updated>2025-04-08T23:38:03Z</updated>
<author>
<name>Pali Rohár</name>
</author>
<published>2025-04-08T22:29:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c7efac7f1c71470ecd9b1a9a49b1b8164583c7dc'/>
<id>urn:sha1:c7efac7f1c71470ecd9b1a9a49b1b8164583c7dc</id>
<content type='text'>
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 &lt;pali@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: Ensure that all non-client-specific reparse points are processed by the server</title>
<updated>2025-04-07T06:07:22Z</updated>
<author>
<name>Pali Rohár</name>
</author>
<published>2025-04-05T17:51:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f8a394aa952257575910d57cf0a63627fa949a2'/>
<id>urn:sha1:6f8a394aa952257575910d57cf0a63627fa949a2</id>
<content type='text'>
Fix regression in mounts to e.g. onedrive shares.

Generally, reparse points are processed by the SMB server during the
SMB OPEN request, but there are few reparse points which do not have
OPEN-like meaning for the SMB server and has to be processed by the SMB
client. Those are symlinks and special files (fifo, socket, block, char).

For Linux SMB client, it is required to process also name surrogate reparse
points as they represent another entity on the SMB server system. Linux
client will mark them as separate mount points. Examples of name surrogate
reparse points are NTFS junction points (e.g. created by the "mklink" tool
on Windows servers).

So after processing the name surrogate reparse points, clear the
-EOPNOTSUPP error code returned from the parse_reparse_point() to let SMB
server to process reparse points.

And remove printing misleading error message "unhandled reparse tag:" as
reparse points are handled by SMB server and hence unhandled fact is normal
operation.

Fixes: cad3fc0a4c8c ("cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from parse_reparse_point()")
Fixes: b587fd128660 ("cifs: Treat unhandled directory name surrogate reparse points as mount directory nodes")
Cc: stable@vger.kernel.org
Reported-by: Junwen Sun &lt;sunjw8888@gmail.com&gt;
Tested-by: Junwen Sun &lt;sunjw8888@gmail.com&gt;
Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from parse_reparse_point()</title>
<updated>2025-02-19T16:42:25Z</updated>
<author>
<name>Pali Rohár</name>
</author>
<published>2024-09-17T22:16:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cad3fc0a4c8cef07b07ceddc137f582267577250'/>
<id>urn:sha1:cad3fc0a4c8cef07b07ceddc137f582267577250</id>
<content type='text'>
This would help to track and detect by caller if the reparse point type was
processed or not.

Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: Add support for creating WSL-style symlinks</title>
<updated>2025-01-31T18:51:44Z</updated>
<author>
<name>Pali Rohár</name>
</author>
<published>2024-09-28T11:24:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e2043be5c149cb07d806c438a8ec8657741bd31'/>
<id>urn:sha1:4e2043be5c149cb07d806c438a8ec8657741bd31</id>
<content type='text'>
This change implements support for creating new symlink in WSL-style by
Linux cifs client when -o reparse=wsl mount option is specified. WSL-style
symlink uses reparse point with tag IO_REPARSE_TAG_LX_SYMLINK and symlink
target location is stored in reparse buffer in UTF-8 encoding prefixed by
32-bit flags. Flags bits are unknown, but it was observed that WSL always
sets flags to value 0x02000000. Do same in Linux cifs client.

New symlinks would be created in WSL-style only in case the mount option
-o reparse=wsl is specified, which is not by default. So default CIFS
mounts are not affected by this change.

Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
</feed>
