lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240915194545.14779-3-pali@kernel.org>
Date: Sun, 15 Sep 2024 21:45:43 +0200
From: Pali Rohár <pali@...nel.org>
To: Steve French <sfrench@...ba.org>,
	Paulo Alcantara <pc@...guebit.com>,
	Ronnie Sahlberg <ronniesahlberg@...il.com>
Cc: linux-cifs@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 2/4] cifs: Fix creating of SFU socket special files

SFU-style socket is file which has system attribute set and file content is
one zero byte. This format was introduced in Interix 3.0 subsystem, as part
of the Microsoft SFU 3.0 and is used also by all later versions. Previous
versions had no UNIX domain socket support.

This format of SFU-style sockets is recognized also by Windows NFS server
included in the latest version on Windows Server 2022.

Currently when sfu mount option is specified then CIFS creates new socket
files with content LnxSOCK. This was introduced in commit 518549c120e6
("cifs: fix creating sockets when using sfu mount options") as nobody
figured out what is the correct SFU format of sockets and tag LnxSOCK was
chosen to allow creating socket files. LnxSOCK looks similar to IntxCHR and
IntxBLK tags which are the proper SFU tags for char and block devices.

It is important to note that LnxSOCK is not SFU-compatible and neither
Interix, SFU, SUA or Windows NFS server recognize file with content of
LnxSOCK as special socket file.

Now when the proper format of SFU-style sockets is known and it was
verified that works with both old Interix 3.x subsystem and also with
Windows NFS server, change implementation of creating new SFU socket files
by CIFS client to be compatible with SFU.

518549c120e6 ("cifs: fix creating sockets when using sfu mount options")
Signed-off-by: Pali Rohár <pali@...nel.org>
---
 fs/smb/client/smb2ops.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 2c251e9a3a30..dc56f7ba1a06 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -5110,10 +5110,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;
-- 
2.20.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ