Commit 8b175e2e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag '6.15-rc-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client updates from Steve French:

 - Fix for network namespace refcount leak

 - Multichannel fix and minor multichannel debug message cleanup

 - Fix potential null ptr reference in SMB3 close

 - Fix for special file handling when reparse points not supported by
   server

 - Two ACL fixes one for stricter ACE validation, one for incorrect
   perms requested

 - Three RFC1001 fixes: one for SMB3 mounts on port 139, one for better
   default hostname, and one for better session response processing

 - Minor update to email address for MAINTAINERS file

 - Allow disabling Unicode for access to old SMB1 servers

 - Three minor cleanups

* tag '6.15-rc-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: Add new mount option -o nounicode to disable SMB1 UNICODE mode
  cifs: Set default Netbios RFC1001 server name to hostname in UNC
  smb: client: Fix netns refcount imbalance causing leaks and use-after-free
  cifs: add validation check for the fields in smb_aces
  CIFS: Propagate min offload along with other parameters from primary to secondary channels.
  cifs: Improve establishing SMB connection with NetBIOS session
  cifs: Fix establishing NetBIOS session for SMB2+ connection
  cifs: Fix getting DACL-only xattr system.cifs_acl and system.smb3_acl
  cifs: Check if server supports reparse points before using them
  MAINTAINERS: reorder preferred email for Steve French
  cifs: avoid NULL pointer dereference in dbg call
  smb: client: Remove redundant check in smb2_is_path_accessible()
  smb: client: Remove redundant check in cifs_oplock_break()
  smb: mark the new channel addition log as informational log with cifs_info
  smb: minor cleanup to remove unused function declaration
parents b6dde1e5 e14b6424
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12905,8 +12905,8 @@ F: tools/testing/selftests/
KERNEL SMB3 SERVER (KSMBD)
M:	Namjae Jeon <linkinjeon@kernel.org>
M:	Namjae Jeon <linkinjeon@samba.org>
M:	Steve French <sfrench@samba.org>
M:	Steve French <smfrench@gmail.com>
M:	Steve French <sfrench@samba.org>
R:	Sergey Senozhatsky <senozhatsky@chromium.org>
R:	Tom Talpey <tom@talpey.com>
L:	linux-cifs@vger.kernel.org
+18 −3
Original line number Diff line number Diff line
@@ -811,7 +811,23 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,
			return;

		for (i = 0; i < num_aces; ++i) {
			if (end_of_acl - acl_base < acl_size)
				break;

			ppace[i] = (struct smb_ace *) (acl_base + acl_size);
			acl_base = (char *)ppace[i];
			acl_size = offsetof(struct smb_ace, sid) +
				offsetof(struct smb_sid, sub_auth);

			if (end_of_acl - acl_base < acl_size ||
			    ppace[i]->sid.num_subauth == 0 ||
			    ppace[i]->sid.num_subauth > SID_MAX_SUB_AUTHORITIES ||
			    (end_of_acl - acl_base <
			     acl_size + sizeof(__le32) * ppace[i]->sid.num_subauth) ||
			    (le16_to_cpu(ppace[i]->size) <
			     acl_size + sizeof(__le32) * ppace[i]->sid.num_subauth))
				break;

#ifdef CONFIG_CIFS_DEBUG2
			dump_ace(ppace[i], end_of_acl);
#endif
@@ -855,7 +871,6 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,
				(void *)ppace[i],
				sizeof(struct smb_ace)); */

			acl_base = (char *)ppace[i];
			acl_size = le16_to_cpu(ppace[i]->size);
		}

@@ -1550,7 +1565,7 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
	int rc = 0;
	struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
	struct smb_version_operations *ops;
	const u32 info = 0;
	const u32 info = OWNER_SECINFO | GROUP_SECINFO | DACL_SECINFO;

	cifs_dbg(NOISY, "converting ACL to mode for %s\n", path);

@@ -1604,7 +1619,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
	struct tcon_link *tlink;
	struct smb_version_operations *ops;
	bool mode_from_sid, id_from_sid;
	const u32 info = 0;
	const u32 info = OWNER_SECINFO | GROUP_SECINFO | DACL_SECINFO;
	bool posix;

	tlink = cifs_sb_tlink(cifs_sb);
+4 −0
Original line number Diff line number Diff line
@@ -637,6 +637,10 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
					   cifs_sb->ctx->dir_mode);
	if (cifs_sb->ctx->iocharset)
		seq_printf(s, ",iocharset=%s", cifs_sb->ctx->iocharset);
	if (tcon->ses->unicode == 0)
		seq_puts(s, ",nounicode");
	else if (tcon->ses->unicode == 1)
		seq_puts(s, ",unicode");
	if (tcon->seal)
		seq_puts(s, ",seal");
	else if (tcon->ses->server->ignore_signature)
+2 −0
Original line number Diff line number Diff line
@@ -653,6 +653,7 @@ struct smb_version_values {
	unsigned int	cap_unix;
	unsigned int	cap_nt_find;
	unsigned int	cap_large_files;
	unsigned int	cap_unicode;
	__u16		signing_enabled;
	__u16		signing_required;
	size_t		create_lease_size;
@@ -1120,6 +1121,7 @@ struct cifs_ses {
	bool sign;		/* is signing required? */
	bool domainAuto:1;
	bool expired_pwd;  /* track if access denied or expired pwd so can know if need to update */
	int unicode;
	unsigned int flags;
	__u16 session_flags;
	__u8 smb3signingkey[SMB3_SIGN_KEY_SIZE];
+3 −1
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ extern void cifs_small_buf_release(void *);
extern void free_rsp_buf(int, void *);
extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
			unsigned int /* length */);
extern int smb_send_kvec(struct TCP_Server_Info *server,
			 struct msghdr *msg,
			 size_t *sent);
extern unsigned int _get_xid(void);
extern void _free_xid(unsigned int);
#define get_xid()							\
@@ -592,7 +595,6 @@ int cifs_async_readv(struct cifs_io_subrequest *rdata);
int cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid);

void cifs_async_writev(struct cifs_io_subrequest *wdata);
void cifs_writev_complete(struct work_struct *work);
int cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
			  struct cifs_sb_info *cifs_sb,
			  const unsigned char *path, char *pbuf,
Loading