Patch "smb3: fix creating FIFOs when mounting with "sfu" mount option" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    smb3: fix creating FIFOs when mounting with "sfu" mount option

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     smb3-fix-creating-fifos-when-mounting-with-sfu-mount-option.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 72bc63f5e23a38b65ff2a201bdc11401d4223fa9 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@xxxxxxxxxxxxx>
Date: Thu, 19 Oct 2023 23:01:49 -0500
Subject: smb3: fix creating FIFOs when mounting with "sfu" mount option

From: Steve French <stfrench@xxxxxxxxxxxxx>

commit 72bc63f5e23a38b65ff2a201bdc11401d4223fa9 upstream.

Fixes some xfstests including generic/564 and generic/157

The "sfu" mount option can be useful for creating special files (character
and block devices in particular) but could not create FIFOs. It did
recognize existing empty files with the "system" attribute flag as FIFOs
but this is too general, so to support creating FIFOs more safely use a new
tag (but the same length as those for char and block devices ie "IntxLNK"
and "IntxBLK") "LnxFIFO" to indicate that the file should be treated as a
FIFO (when mounted with the "sfu").   For some additional context note that
"sfu" followed the way that "Services for Unix" on Windows handled these
special files (at least for character and block devices and symlinks),
which is different than newer Windows which can handle special files
as reparse points (which isn't an option to many servers).

Cc: stable@xxxxxxxxxxxxxxx
Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/smb/client/cifspdu.h |    2 +-
 fs/smb/client/inode.c   |    4 ++++
 fs/smb/client/smb2ops.c |    8 +++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

--- a/fs/smb/client/cifspdu.h
+++ b/fs/smb/client/cifspdu.h
@@ -2570,7 +2570,7 @@ typedef struct {
 
 
 struct win_dev {
-	unsigned char type[8]; /* IntxCHR or IntxBLK */
+	unsigned char type[8]; /* IntxCHR or IntxBLK or LnxFIFO*/
 	__le64 major;
 	__le64 minor;
 } __attribute__((packed));
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -567,6 +567,10 @@ cifs_sfu_type(struct cifs_fattr *fattr,
 			cifs_dbg(FYI, "Symlink\n");
 			fattr->cf_mode |= S_IFLNK;
 			fattr->cf_dtype = DT_LNK;
+		} else if (memcmp("LnxFIFO", pbuf, 8) == 0) {
+			cifs_dbg(FYI, "FIFO\n");
+			fattr->cf_mode |= S_IFIFO;
+			fattr->cf_dtype = DT_FIFO;
 		} else {
 			fattr->cf_mode |= S_IFREG; /* file? */
 			fattr->cf_dtype = DT_REG;
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -5212,7 +5212,7 @@ smb2_make_node(unsigned int xid, struct
 	 * over SMB2/SMB3 and Samba will do this with SMB3.1.1 POSIX Extensions
 	 */
 
-	if (!S_ISCHR(mode) && !S_ISBLK(mode))
+	if (!S_ISCHR(mode) && !S_ISBLK(mode) && !S_ISFIFO(mode))
 		return rc;
 
 	cifs_dbg(FYI, "sfu compat create special file\n");
@@ -5260,6 +5260,12 @@ smb2_make_node(unsigned int xid, struct
 		pdev->minor = cpu_to_le64(MINOR(dev));
 		rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
 							&bytes_written, iov, 1);
+	} else if (S_ISFIFO(mode)) {
+		memcpy(pdev->type, "LnxFIFO", 8);
+		pdev->major = 0;
+		pdev->minor = 0;
+		rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
+							&bytes_written, iov, 1);
 	}
 	tcon->ses->server->ops->close(xid, tcon, &fid);
 	d_drop(dentry);


Patches currently in stable-queue which might be from stfrench@xxxxxxxxxxxxx are

queue-6.5/smb3-fix-caching-of-ctime-on-setxattr.patch
queue-6.5/cifs-spnego-add-in-host_key_len.patch
queue-6.5/ksmbd-handle-malformed-smb1-message.patch
queue-6.5/cifs-reconnect-helper-should-set-reconnect-for-the-right-channel.patch
queue-6.5/smb3-fix-touch-h-of-symlink.patch
queue-6.5/ksmbd-fix-recursive-locking-in-vfs-helpers.patch
queue-6.5/cifs-do-not-reset-chan_max-if-multichannel-is-not-supported-at-mount.patch
queue-6.5/smb3-fix-creating-fifos-when-mounting-with-sfu-mount-option.patch
queue-6.5/cifs-fix-check-of-rc-in-function-generate_smb3signin.patch
queue-6.5/smb3-allow-dumping-session-and-tcon-id-to-improve-stats-analysis-and-debugging.patch
queue-6.5/smb-client-fix-use-after-free-bug-in-cifs_debug_data_proc_show.patch
queue-6.5/cifs-force-interface-update-before-a-fresh-session-setup.patch
queue-6.5/smb-client-fix-potential-deadlock-when-releasing-mids.patch
queue-6.5/smb-client-fix-use-after-free-in-smb2_query_info_compound.patch
queue-6.5/ksmbd-fix-slab-out-of-bounds-write-in-smb_inherit_dacl.patch
queue-6.5/cifs-fix-encryption-of-cleared-but-unset-rq_iter-data-buffers.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux