Skip to content

Commit

Permalink
Merge tag '6.4-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/…
Browse files Browse the repository at this point in the history
…cifs-2.6

Pull smb directory moves and client fixes from Steve French:
 "Four smb3 client fixes (three of which marked for stable) and three
  patches to move of fs/cifs and fs/ksmbd to a new common "fs/smb"
  parent directory

   - Move the client and server source directories to a common parent
     directory:

       fs/cifs -> fs/smb/client
       fs/ksmbd -> fs/smb/server
       fs/smbfs_common -> fs/smb/common

   - important readahead fix

   - important fix for SMB1 regression

   - fix for missing mount option ("mapchars") in mount API conversion

   - minor debugging improvement"

* tag '6.4-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  smb3: move Documentation/filesystems/cifs to Documentation/filesystems/smb
  cifs: correct references in Documentation to old fs/cifs path
  smb: move client and server files to common directory fs/smb
  cifs: mapchars mount option ignored
  smb3: display debug information better for encryption
  cifs: fix smb1 mount regression
  cifs: Fix cifs_limit_bvec_subset() to correctly check the maxmimum size
  • Loading branch information
torvalds committed May 26, 2023
2 parents 192fe71 + ab6cacf commit 0d85b27
Show file tree
Hide file tree
Showing 156 changed files with 59 additions and 39 deletions.
4 changes: 2 additions & 2 deletions Documentation/admin-guide/cifs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Changes
See https://wiki.samba.org/index.php/LinuxCIFSKernel for summary
information about fixes/improvements to CIFS/SMB2/SMB3 support (changes
to cifs.ko module) by kernel version (and cifs internal module version).
This may be easier to read than parsing the output of "git log fs/cifs"
by release.
This may be easier to read than parsing the output of
"git log fs/smb/client" by release.
8 changes: 4 additions & 4 deletions Documentation/admin-guide/cifs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Installation instructions

If you have built the CIFS vfs as module (successfully) simply
type ``make modules_install`` (or if you prefer, manually copy the file to
the modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.ko).
the modules directory e.g. /lib/modules/6.3.0-060300-generic/kernel/fs/smb/client/cifs.ko).

If you have built the CIFS vfs into the kernel itself, follow the instructions
for your distribution on how to install a new kernel (usually you
Expand All @@ -66,15 +66,15 @@ If cifs is built as a module, then the size and number of network buffers
and maximum number of simultaneous requests to one server can be configured.
Changing these from their defaults is not recommended. By executing modinfo::

modinfo kernel/fs/cifs/cifs.ko
modinfo <path to cifs.ko>

on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made
on kernel/fs/smb/client/cifs.ko the list of configuration changes that can be made
at module initialization time (by running insmod cifs.ko) can be seen.

Recommendations
===============

To improve security the SMB2.1 dialect or later (usually will get SMB3) is now
To improve security the SMB2.1 dialect or later (usually will get SMB3.1.1) is now
the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0"
on mount (or vers=2.0 for Windows Vista). Note that the CIFS (vers=1.0) is
much older and less secure than the default dialect SMB3 which includes
Expand Down
2 changes: 1 addition & 1 deletion Documentation/filesystems/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ Documentation for filesystem implementations.
befs
bfs
btrfs
cifs/index
ceph
coda
configfs
Expand Down Expand Up @@ -111,6 +110,7 @@ Documentation for filesystem implementations.
ramfs-rootfs-initramfs
relay
romfs
smb/index
spufs/index
squashfs
sysfs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ the root file system via SMB protocol.
Enables the kernel to mount the root file system via SMB that are
located in the <server-ip> and <share> specified in this option.

The default mount options are set in fs/cifs/cifsroot.c.
The default mount options are set in fs/smb/client/cifsroot.c.

server-ip
IPv4 address of the server.
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Documentation/userspace-api/ioctl/ioctl-number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Code Seq# Include File Comments
0xCC 00-0F drivers/misc/ibmvmc.h pseries VMC driver
0xCD 01 linux/reiserfs_fs.h
0xCE 01-02 uapi/linux/cxl_mem.h Compute Express Link Memory Devices
0xCF 02 fs/cifs/ioctl.c
0xCF 02 fs/smb/client/cifs_ioctl.h
0xDB 00-0F drivers/char/mwave/mwavepub.h
0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
<mailto:[email protected]>
Expand Down
10 changes: 5 additions & 5 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5140,8 +5140,8 @@ S: Supported
W: https://wiki.samba.org/index.php/LinuxCIFS
T: git git://git.samba.org/sfrench/cifs-2.6.git
F: Documentation/admin-guide/cifs/
F: fs/cifs/
F: fs/smbfs_common/
F: fs/smb/client/
F: fs/smb/common/
F: include/uapi/linux/cifs

COMPACTPCI HOTPLUG CORE
Expand Down Expand Up @@ -11301,9 +11301,9 @@ R: Tom Talpey <[email protected]>
L: [email protected]
S: Maintained
T: git git://git.samba.org/ksmbd.git
F: Documentation/filesystems/cifs/ksmbd.rst
F: fs/ksmbd/
F: fs/smbfs_common/
F: Documentation/filesystems/smb/ksmbd.rst
F: fs/smb/common/
F: fs/smb/server/

KERNEL UNIT TESTING FRAMEWORK (KUnit)
M: Brendan Higgins <[email protected]>
Expand Down
9 changes: 1 addition & 8 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,7 @@ config NFS_V4_2_SSC_HELPER
source "net/sunrpc/Kconfig"
source "fs/ceph/Kconfig"

source "fs/cifs/Kconfig"
source "fs/ksmbd/Kconfig"

config SMBFS_COMMON
tristate
default y if CIFS=y || SMB_SERVER=y
default m if CIFS=m || SMB_SERVER=m

source "fs/smb/Kconfig"
source "fs/coda/Kconfig"
source "fs/afs/Kconfig"
source "fs/9p/Kconfig"
Expand Down
4 changes: 1 addition & 3 deletions fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ obj-$(CONFIG_LOCKD) += lockd/
obj-$(CONFIG_NLS) += nls/
obj-y += unicode/
obj-$(CONFIG_SYSV_FS) += sysv/
obj-$(CONFIG_SMBFS_COMMON) += smbfs_common/
obj-$(CONFIG_CIFS) += cifs/
obj-$(CONFIG_SMB_SERVER) += ksmbd/
obj-$(CONFIG_SMBFS) += smb/
obj-$(CONFIG_HPFS_FS) += hpfs/
obj-$(CONFIG_NTFS_FS) += ntfs/
obj-$(CONFIG_NTFS3_FS) += ntfs3/
Expand Down
11 changes: 11 additions & 0 deletions fs/smb/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# smbfs configuration

source "fs/smb/client/Kconfig"
source "fs/smb/server/Kconfig"

config SMBFS
tristate
default y if CIFS=y || SMB_SERVER=y
default m if CIFS=m || SMB_SERVER=m
5 changes: 5 additions & 0 deletions fs/smb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0

obj-$(CONFIG_SMBFS) += common/
obj-$(CONFIG_CIFS) += client/
obj-$(CONFIG_SMB_SERVER) += server/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions fs/cifs/cifs_debug.c → fs/smb/client/cifs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
if ((tcon->seal) ||
(tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) ||
(tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA))
seq_printf(m, " Encrypted");
seq_puts(m, " encrypted");
if (tcon->nocase)
seq_printf(m, " nocase");
if (tcon->unix_ext)
Expand Down Expand Up @@ -415,8 +415,12 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)

/* dump session id helpful for use with network trace */
seq_printf(m, " SessionId: 0x%llx", ses->Suid);
if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) {
seq_puts(m, " encrypted");
/* can help in debugging to show encryption type */
if (server->cipher_type == SMB2_ENCRYPTION_AES256_GCM)
seq_puts(m, "(gcm256)");
}
if (ses->sign)
seq_puts(m, " signed");

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fs/cifs/cifsencrypt.c → fs/smb/client/cifsencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <linux/random.h>
#include <linux/highmem.h>
#include <linux/fips.h>
#include "../smbfs_common/arc4.h"
#include "../common/arc4.h"
#include <crypto/aead.h>

/*
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fs/cifs/cifsglob.h → fs/smb/client/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "cifsacl.h"
#include <crypto/internal/hash.h>
#include <uapi/linux/cifs/cifs_mount.h>
#include "../smbfs_common/smb2pdu.h"
#include "../common/smb2pdu.h"
#include "smb2pdu.h"
#include <linux/filelock.h>

Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifspdu.h → fs/smb/client/cifspdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <net/sock.h>
#include <asm/unaligned.h>
#include "../smbfs_common/smbfsctl.h"
#include "../common/smbfsctl.h"

#define CIFS_PROT 0
#define POSIX_PROT (CIFS_PROT+1)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fs/cifs/dfs.c → fs/smb/client/dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int dfs_mount_share(struct cifs_mount_ctx *mnt_ctx, bool *isdfs)
if (!nodfs) {
rc = dfs_get_referral(mnt_ctx, ctx->UNC + 1, NULL, NULL);
if (rc) {
if (rc != -ENOENT && rc != -EOPNOTSUPP)
if (rc != -ENOENT && rc != -EOPNOTSUPP && rc != -EIO)
goto out;
nodfs = true;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion fs/cifs/file.c → fs/smb/client/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3353,9 +3353,10 @@ static size_t cifs_limit_bvec_subset(const struct iov_iter *iter, size_t max_siz
while (n && ix < nbv) {
len = min3(n, bvecs[ix].bv_len - skip, max_size);
span += len;
max_size -= len;
nsegs++;
ix++;
if (span >= max_size || nsegs >= max_segs)
if (max_size == 0 || nsegs >= max_segs)
break;
skip = 0;
n -= len;
Expand Down
8 changes: 8 additions & 0 deletions fs/cifs/fs_context.c → fs/smb/client/fs_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,14 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
ctx->sfu_remap = false; /* disable SFU mapping */
}
break;
case Opt_mapchars:
if (result.negated)
ctx->sfu_remap = false;
else {
ctx->sfu_remap = true;
ctx->remap = false; /* disable SFM (mapposix) mapping */
}
break;
case Opt_user_xattr:
if (result.negated)
ctx->no_xattr = 1;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fs/cifs/smbencrypt.c → fs/smb/client/smbencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "cifsglob.h"
#include "cifs_debug.h"
#include "cifsproto.h"
#include "../smbfs_common/md4.h"
#include "../common/md4.h"

#ifndef false
#define false 0
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions fs/smbfs_common/Makefile → fs/smb/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Makefile for Linux filesystem routines that are shared by client and server.
#

obj-$(CONFIG_SMBFS_COMMON) += cifs_arc4.o
obj-$(CONFIG_SMBFS_COMMON) += cifs_md4.o
obj-$(CONFIG_SMBFS) += cifs_arc4.o
obj-$(CONFIG_SMBFS) += cifs_md4.o
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fs/ksmbd/auth.c → fs/smb/server/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "mgmt/user_config.h"
#include "crypto_ctx.h"
#include "transport_ipc.h"
#include "../smbfs_common/arc4.h"
#include "../common/arc4.h"

/*
* Fixed format data defining GSS header and fixed string
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fs/ksmbd/smb_common.h → fs/smb/server/smb_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "glob.h"
#include "nterr.h"
#include "../smbfs_common/smb2pdu.h"
#include "../common/smb2pdu.h"
#include "smb2pdu.h"

/* ksmbd's Specific ERRNO */
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fs/ksmbd/smbfsctl.h → fs/smb/server/smbfsctl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
/*
* fs/cifs/smbfsctl.h: SMB, CIFS, SMB2 FSCTL definitions
* fs/smb/server/smbfsctl.h: SMB, CIFS, SMB2 FSCTL definitions
*
* Copyright (c) International Business Machines Corp., 2002,2009
* Author(s): Steve French ([email protected])
Expand Down
2 changes: 1 addition & 1 deletion fs/ksmbd/smbstatus.h → fs/smb/server/smbstatus.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
/*
* fs/cifs/smb2status.h
* fs/server/smb2status.h
*
* SMB2 Status code (network error) definitions
* Definitions are from MS-ERREF
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0d85b27

Please sign in to comment.