Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a040b21 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull SMB3 fixes from Steve French:
 "Some small bug fixes as well as SMB2.1/SMB3 enablement for DFS (global
  namespace) which previously was only enabled for CIFS"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  smb2: Enforce sec= mount option
  CIFS: Fix sparse warnings
  CIFS: implement get_dfs_refer for SMB2+
  CIFS: use DFS pathnames in SMB2+ Create requests
  CIFS: set signing flag in SMB2+ TreeConnect if needed
  CIFS: let ses->ipc_tid hold smb2 TreeIds
  CIFS: add use_ipc flag to SMB2_ioctl()
  CIFS: add build_path_from_dentry_optional_prefix()
  CIFS: move DFS response parsing out of SMB1 code
  CIFS: Fix possible use after free in demultiplex thread
parents 4e66c42c ef65aaed
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -303,7 +303,9 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
	 * gives us the latter, so we must adjust the result.
	 * gives us the latter, so we must adjust the result.
	 */
	 */
	mnt = ERR_PTR(-ENOMEM);
	mnt = ERR_PTR(-ENOMEM);
	full_path = build_path_from_dentry(mntpt);

	/* always use tree name prefix */
	full_path = build_path_from_dentry_optional_prefix(mntpt, true);
	if (full_path == NULL)
	if (full_path == NULL)
		goto cdda_exit;
		goto cdda_exit;


+3 −3
Original line number Original line Diff line number Diff line
@@ -130,10 +130,10 @@ wchar_t cifs_toupper(wchar_t in);
 * Returns:
 * Returns:
 *     Address of the first string
 *     Address of the first string
 */
 */
static inline wchar_t *
static inline __le16 *
UniStrcat(wchar_t *ucs1, const wchar_t *ucs2)
UniStrcat(__le16 *ucs1, const __le16 *ucs2)
{
{
	wchar_t *anchor = ucs1;	/* save a pointer to start of ucs1 */
	__le16 *anchor = ucs1;	/* save a pointer to start of ucs1 */


	while (*ucs1++) ;	/* To end of first string */
	while (*ucs1++) ;	/* To end of first string */
	ucs1--;			/* Return to the null */
	ucs1--;			/* Return to the null */
+4 −1
Original line number Original line Diff line number Diff line
@@ -443,6 +443,9 @@ struct smb_version_operations {
	int (*is_transform_hdr)(void *buf);
	int (*is_transform_hdr)(void *buf);
	int (*receive_transform)(struct TCP_Server_Info *,
	int (*receive_transform)(struct TCP_Server_Info *,
				 struct mid_q_entry **);
				 struct mid_q_entry **);
	enum securityEnum (*select_sectype)(struct TCP_Server_Info *,
			    enum securityEnum);

};
};


struct smb_version_values {
struct smb_version_values {
@@ -822,7 +825,7 @@ struct cifs_ses {
	int ses_count;		/* reference counter */
	int ses_count;		/* reference counter */
	enum statusEnum status;
	enum statusEnum status;
	unsigned overrideSecFlg;  /* if non-zero override global sec flags */
	unsigned overrideSecFlg;  /* if non-zero override global sec flags */
	__u16 ipc_tid;		/* special tid for connection to IPC share */
	__u32 ipc_tid;		/* special tid for connection to IPC share */
	char *serverOS;		/* name of operating system underlying server */
	char *serverOS;		/* name of operating system underlying server */
	char *serverNOS;	/* name of network operating system of server */
	char *serverNOS;	/* name of network operating system of server */
	char *serverDomain;	/* security realm of server */
	char *serverDomain;	/* security realm of server */
+10 −6
Original line number Original line Diff line number Diff line
@@ -2086,17 +2086,21 @@ typedef struct dfs_referral_level_3 { /* version 4 is same, + one flag bit */
	__u8   ServiceSiteGuid[16];  /* MBZ, ignored */
	__u8   ServiceSiteGuid[16];  /* MBZ, ignored */
} __attribute__((packed)) REFERRAL3;
} __attribute__((packed)) REFERRAL3;


typedef struct smb_com_transaction_get_dfs_refer_rsp {
struct get_dfs_referral_rsp {
	struct smb_hdr hdr;	/* wct = 10 */
	struct trans2_resp t2;
	__u16 ByteCount;
	__u8 Pad;
	__le16 PathConsumed;
	__le16 PathConsumed;
	__le16 NumberOfReferrals;
	__le16 NumberOfReferrals;
	__le32 DFSFlags;
	__le32 DFSFlags;
	REFERRAL3 referrals[1];	/* array of level 3 dfs_referral structures */
	REFERRAL3 referrals[1];	/* array of level 3 dfs_referral structures */
	/* followed by the strings pointed to by the referral structures */
	/* followed by the strings pointed to by the referral structures */
} __attribute__((packed)) TRANSACTION2_GET_DFS_REFER_RSP;
} __packed;

typedef struct smb_com_transaction_get_dfs_refer_rsp {
	struct smb_hdr hdr;	/* wct = 10 */
	struct trans2_resp t2;
	__u16 ByteCount;
	__u8 Pad;
	struct get_dfs_referral_rsp dfs_data;
} __packed TRANSACTION2_GET_DFS_REFER_RSP;


/* DFS Flags */
/* DFS Flags */
#define DFSREF_REFERRAL_SERVER  0x00000001 /* all targets are DFS roots */
#define DFSREF_REFERRAL_SERVER  0x00000001 /* all targets are DFS roots */
+9 −0
Original line number Original line Diff line number Diff line
@@ -61,6 +61,8 @@ extern void exit_cifs_idmap(void);
extern int init_cifs_spnego(void);
extern int init_cifs_spnego(void);
extern void exit_cifs_spnego(void);
extern void exit_cifs_spnego(void);
extern char *build_path_from_dentry(struct dentry *);
extern char *build_path_from_dentry(struct dentry *);
extern char *build_path_from_dentry_optional_prefix(struct dentry *direntry,
						    bool prefix);
extern char *cifs_build_path_to_root(struct smb_vol *vol,
extern char *cifs_build_path_to_root(struct smb_vol *vol,
				     struct cifs_sb_info *cifs_sb,
				     struct cifs_sb_info *cifs_sb,
				     struct cifs_tcon *tcon,
				     struct cifs_tcon *tcon,
@@ -284,6 +286,11 @@ extern int get_dfs_path(const unsigned int xid, struct cifs_ses *ses,
			const struct nls_table *nls_codepage,
			const struct nls_table *nls_codepage,
			unsigned int *num_referrals,
			unsigned int *num_referrals,
			struct dfs_info3_param **referrals, int remap);
			struct dfs_info3_param **referrals, int remap);
extern int parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size,
			       unsigned int *num_of_nodes,
			       struct dfs_info3_param **target_nodes,
			       const struct nls_table *nls_codepage, int remap,
			       const char *searchName, bool is_unicode);
extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
				 struct cifs_sb_info *cifs_sb,
				 struct cifs_sb_info *cifs_sb,
				 struct smb_vol *vol);
				 struct smb_vol *vol);
@@ -526,4 +533,6 @@ int cifs_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
int __cifs_calc_signature(struct smb_rqst *rqst,
int __cifs_calc_signature(struct smb_rqst *rqst,
			struct TCP_Server_Info *server, char *signature,
			struct TCP_Server_Info *server, char *signature,
			struct shash_desc *shash);
			struct shash_desc *shash);
enum securityEnum cifs_select_sectype(struct TCP_Server_Info *,
					enum securityEnum);
#endif			/* _CIFSPROTO_H */
#endif			/* _CIFSPROTO_H */
Loading