Commit 81dc1e4d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'v7.1-rc1-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client updates from Steve French:

 - Fix EAs bounds check

 - Fix OOB read in symlink response parsing

 - Add support for creating tmpfiles

 - Minor debug improvement for mount failure

 - Minor crypto cleanup

 - Add missing module description

 - mount fix for lease vs. nolease

 - Add Metze as maintainer for smbdirect

 - Minor error mapping header cleanup

 - Improve search speed of SMB1 maperror

 - Fix potential null ptr ref in smb2 map error tests

* tag 'v7.1-rc1-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: (26 commits)
  smb: client: allow both 'lease' and 'nolease' mount options
  smb: client: get rid of d_drop()+d_add()
  smb: client: set ATTR_TEMPORARY with O_TMPFILE | O_EXCL
  smb: client: add support for O_TMPFILE
  vfs: introduce d_mark_tmpfile_name()
  MAINTAINERS: create entry for smbdirect
  smb: client: add missing MODULE_DESCRIPTION() to smb1maperror_test
  smb: client: fix OOB reads parsing symlink error response
  smb: client: fix off-by-8 bounds check in check_wsl_eas()
  smb: client: Remove unnecessary selection of CRYPTO_ECB
  smb/client: move smb2maperror declarations to smb2proto.h
  smb/client: introduce KUnit tests to check DOS/SRV err mapping search
  smb/client: check if SMB1 DOS/SRV error mapping arrays are sorted
  smb/client: use binary search for SMB1 DOS/SRV error mapping
  smb/client: autogenerate SMB1 DOS/SRV to POSIX error mapping
  smb/client: annotate smberr.h with POSIX error codes
  smb/client: move ERRnetlogonNotStarted to DOS error class
  smb/client: introduce KUnit test to check ntstatus_to_dos_map search
  smb/client: check if ntstatus_to_dos_map is sorted
  smb/client: use binary search for NT status to DOS mapping
  ...
parents 0b0128e6 4248ed10
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -24401,6 +24401,20 @@ T: git https://github.com/cschaufler/smack-next.git
F:	Documentation/admin-guide/LSM/Smack.rst
F:	security/smack/
SMBDIRECT (RDMA Stream Transport with Read/Write-Offload, MS-SMBD)
M:	Steve French <smfrench@gmail.com>
M:	Steve French <sfrench@samba.org>
M:	Namjae Jeon <linkinjeon@kernel.org>
M:	Namjae Jeon <linkinjeon@samba.org>
R:	Stefan Metzmacher <metze@samba.org>
R:	Tom Talpey <tom@talpey.com>
L:	linux-cifs@vger.kernel.org
L:	samba-technical@lists.samba.org (moderated for non-subscribers)
S:	Maintained
F:	fs/smb/client/smbdirect.*
F:	fs/smb/common/smbdirect/
F:	fs/smb/server/transport_rdma.*
SMC91x ETHERNET DRIVER
M:	Nicolas Pitre <nico@fluxnic.net>
S:	Odd Fixes
+19 −0
Original line number Diff line number Diff line
@@ -3196,6 +3196,25 @@ void d_mark_tmpfile(struct file *file, struct inode *inode)
}
EXPORT_SYMBOL(d_mark_tmpfile);

void d_mark_tmpfile_name(struct file *file, const struct qstr *name)
{
	struct dentry *dentry = file->f_path.dentry;
	char *dname = dentry->d_shortname.string;

	BUG_ON(dname_external(dentry));
	BUG_ON(d_really_is_positive(dentry));
	BUG_ON(!d_unlinked(dentry));
	BUG_ON(name->len > DNAME_INLINE_LEN - 1);
	spin_lock(&dentry->d_parent->d_lock);
	spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
	dentry->__d_name.len = name->len;
	memcpy(dname, name->name, name->len);
	dname[name->len] = '\0';
	spin_unlock(&dentry->d_lock);
	spin_unlock(&dentry->d_parent->d_lock);
}
EXPORT_SYMBOL(d_mark_tmpfile_name);

void d_tmpfile(struct file *file, struct inode *inode)
{
	struct dentry *dentry = file->f_path.dentry;
+3 −0
Original line number Diff line number Diff line
smb1_mapping_table.c
smb1_err_dos_map.c
smb1_err_srv_map.c
smb2_mapping_table.c
+11 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ config CIFS
	select CRYPTO_AEAD2
	select CRYPTO_CCM
	select CRYPTO_GCM
	select CRYPTO_ECB
	select CRYPTO_AES
	select CRYPTO_LIB_ARC4
	select CRYPTO_LIB_MD5
@@ -217,4 +216,15 @@ config CIFS_COMPRESSION
	  Say Y here if you want SMB traffic to be compressed.
	  If unsure, say N.

config SMB1_KUNIT_TESTS
	tristate "KUnit tests for SMB1"
	depends on SMB_KUNIT_TESTS && CIFS_ALLOW_INSECURE_LEGACY
	default SMB_KUNIT_TESTS
	help
	  This builds the SMB1-specific KUnit tests.

	  These tests are only enabled when legacy insecure SMB1 support
	  (CIFS_ALLOW_INSECURE_LEGACY) is enabled.

	  If unsure, say N.
endif
+23 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ obj-$(CONFIG_CIFS) += cifs.o

cifs-y := trace.o cifsfs.o cifs_debug.o connect.o dir.o file.o \
	  inode.o link.o misc.o netmisc.o smbencrypt.o transport.o \
	  cached_dir.o cifs_unicode.o nterr.o cifsencrypt.o \
	  cached_dir.o cifs_unicode.o cifsencrypt.o \
	  readdir.o ioctl.o sess.o export.o unc.o winucase.o \
	  smb2ops.o smb2maperror.o smb2transport.o \
	  smb2misc.o smb2pdu.o smb2inode.o smb2file.o cifsacl.o fs_context.o \
@@ -44,6 +44,26 @@ cifs-$(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) += \

cifs-$(CONFIG_CIFS_COMPRESSION) += compress.o compress/lz77.o

ifneq ($(CONFIG_CIFS_ALLOW_INSECURE_LEGACY),)
#
# Build the SMB1 error mapping tables from nterr.h and smberr.h
#
smb1-gen-y := smb1_mapping_table.c \
	      smb1_err_dos_map.c \
	      smb1_err_srv_map.c

$(obj)/smb1_mapping_table.c: $(src)/nterr.h $(src)/gen_smb1_mapping FORCE
	$(call if_changed,gen_smb1_mapping)

$(obj)/smb1_err_%.c: $(src)/smberr.h $(src)/gen_smb1_mapping FORCE
	$(call if_changed,gen_smb1_mapping)

$(obj)/smb1maperror.o: $(addprefix $(obj)/, $(smb1-gen-y))

quiet_cmd_gen_smb1_mapping = GEN     $@
      cmd_gen_smb1_mapping = perl $(src)/gen_smb1_mapping $< $@
endif

#
# Build the SMB2 error mapping table from smb2status.h
#
@@ -56,7 +76,8 @@ $(obj)/smb2maperror.o: $(obj)/smb2_mapping_table.c
quiet_cmd_gen_smb2_mapping = GEN     $@
      cmd_gen_smb2_mapping = perl $(src)/gen_smb2_mapping $< $@

obj-$(CONFIG_SMB1_KUNIT_TESTS) += smb1maperror_test.o
obj-$(CONFIG_SMB_KUNIT_TESTS) += smb2maperror_test.o

# Let Kbuild handle tracking and cleaning
targets += smb2_mapping_table.c
targets += smb2_mapping_table.c $(smb1-gen-y)
Loading