]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cifs: Fix support for creating SFU socket
authorPali Rohár <pali@kernel.org>
Tue, 7 Jul 2026 09:03:18 +0000 (11:03 +0200)
committerSteve French <stfrench@microsoft.com>
Wed, 8 Jul 2026 23:44:33 +0000 (18:44 -0500)
SFU sockets are natively supported by Interix 3.0 subsystem and also by
later versions. It is part of Microsoft SFU (Windows Services for UNIX) and
Microsoft SUA (Subsystem for UNIX-based Applications). They can be created
and existing (stored on local disk or remote SMB share) can be recognized.

SFU sockets are recognized also by NFS server included in Windows Server.
Windows NFS server versions since Windows Server 2012 uses new reparse
point format for storing new sockets, but still can recognize this old
format (also in the latest Windows Server 2022 version).

SFU-style socket is a regular file which has system attribute set and
content of the file is one zero byte.

These SFU-style sockets are already recognized by Linux SMB client.

But Linux SMB client is currently creating new SFU socket in different
format which is not compatible with all those SFU applications. Fix this by
creating new sockets in correct SFU format which would be recognized by all
SFU, SUA, NFS and existing Linux SMB clients.

This change affects only creating new sockets when mount option -o sfu is used.

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c

index 06e9322a762ae43aa856805059674120500a73a3..b4fa43f32e5159e2e0fad2dde76010e153fc6f5e 100644 (file)
@@ -5286,10 +5286,9 @@ int __cifs_sfu_make_node(unsigned int xid, struct inode *inode,
                data = (u8 *)symname_utf16;
                break;
        case S_IFSOCK:
-               type_len = 8;
-               strscpy(type, "LnxSOCK");
-               data = (u8 *)&pdev;
-               data_len = sizeof(pdev);
+               /* SFU socket is system file with one zero byte */
+               type_len = 1;
+               type[0] = '\0';
                break;
        case S_IFIFO:
                type_len = 8;