mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
10 smb3/cifs client fixes
-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmf5UscACgkQiiy9cAdy T1F6HAv+KNyqHIUEo/tP6oSIrys8QbGcQeCHWuc683hG6hHCP9pKGbyf/GyQHneU lilsd3N+2RvQqE5TDDVZgMK6XLk/NPmr7FFCWft/vVRD0IADzrB5OTKZ+1ys1aQL UwazIhNlBjBvXtFmXUQF+bRivvun5qEP8pZt/dGFRBsSDhEIX4CbepwoNONTVCyd 3dzdaGe6/r9W/Dj3EfOdHOtFUeBw0ENSgCOdWpitIIa8fW580z9tNJZk0rNo61y4 siJfMD3OddwoPKD6igw63fdmYJ8xO24zWVa4YtMmLh4m39ywFxuu8d49KF75tfrV OnHA/Uo23tZC5EqS2s5F0fZa/g4SjmyW1SVNHzcOYT0cbzVnOngk+usAluAdnZLL LB4SbIefOCAkliOzydIdTsUNKMTu8UuhG8pOWNq+XxzwhLKSRhxz4dpCT7lBUPSI dzLr1DA8KxjNmunZHJbEHOgg+XdcdmuSgbKXDTf+4U7R7Ah46+aU0xE8QVuwDGW7 ItqeEqF/ =LO/y -----END PGP SIGNATURE----- Merge tag 'v6.15-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - Fix multichannel decryption UAF - Fix regression mounting to onedrive shares - Fix missing mount option check for posix vs. noposix - Fix version field in WSL symlinks - Three minor cleanup to reparse point handling - SMB1 fix for WSL special files - SMB1 Kerberos fix - Add SMB3 defines for two new FS attributes * tag 'v6.15-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: Add defines for two new FileSystemAttributes cifs: Fix querying of WSL CHR and BLK reparse points over SMB1 cifs: Split parse_reparse_point callback to functions: get buffer and parse buffer cifs: Improve handling of name surrogate reparse points in reparse.c cifs: Remove explicit handling of IO_REPARSE_TAG_MOUNT_POINT in inode.c cifs: Fix encoding of SMB1 Session Setup Kerberos Request in non-UNICODE mode smb: client: fix UAF in decryption with multichannel cifs: Fix support for WSL-style symlinks smb311 client: fix missing tcon check when mounting with linux/posix extensions cifs: Ensure that all non-client-specific reparse points are processed by the server
This commit is contained in:
commit
3bde70a2c8
|
|
@ -704,18 +704,12 @@ cifs_crypto_secmech_release(struct TCP_Server_Info *server)
|
|||
cifs_free_hash(&server->secmech.md5);
|
||||
cifs_free_hash(&server->secmech.sha512);
|
||||
|
||||
if (!SERVER_IS_CHAN(server)) {
|
||||
if (server->secmech.enc) {
|
||||
crypto_free_aead(server->secmech.enc);
|
||||
server->secmech.enc = NULL;
|
||||
}
|
||||
|
||||
if (server->secmech.dec) {
|
||||
crypto_free_aead(server->secmech.dec);
|
||||
server->secmech.dec = NULL;
|
||||
}
|
||||
} else {
|
||||
if (server->secmech.enc) {
|
||||
crypto_free_aead(server->secmech.enc);
|
||||
server->secmech.enc = NULL;
|
||||
}
|
||||
if (server->secmech.dec) {
|
||||
crypto_free_aead(server->secmech.dec);
|
||||
server->secmech.dec = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,10 +625,8 @@ struct smb_version_operations {
|
|||
bool (*is_status_io_timeout)(char *buf);
|
||||
/* Check for STATUS_NETWORK_NAME_DELETED */
|
||||
bool (*is_network_name_deleted)(char *buf, struct TCP_Server_Info *srv);
|
||||
int (*parse_reparse_point)(struct cifs_sb_info *cifs_sb,
|
||||
const char *full_path,
|
||||
struct kvec *rsp_iov,
|
||||
struct cifs_open_info_data *data);
|
||||
struct reparse_data_buffer * (*get_reparse_point_buffer)(const struct kvec *rsp_iov,
|
||||
u32 *plen);
|
||||
int (*create_reparse_symlink)(const unsigned int xid,
|
||||
struct inode *inode,
|
||||
struct dentry *dentry,
|
||||
|
|
|
|||
|
|
@ -2256,6 +2256,8 @@ typedef struct {
|
|||
#define FILE_SUPPORTS_ENCRYPTION 0x00020000
|
||||
#define FILE_SUPPORTS_OBJECT_IDS 0x00010000
|
||||
#define FILE_VOLUME_IS_COMPRESSED 0x00008000
|
||||
#define FILE_SUPPORTS_POSIX_UNLINK_RENAME 0x00000400
|
||||
#define FILE_RETURNS_CLEANUP_RESULT_INFO 0x00000200
|
||||
#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
|
||||
#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
|
||||
#define FILE_SUPPORTS_SPARSE_FILES 0x00000040
|
||||
|
|
|
|||
|
|
@ -2556,6 +2556,8 @@ static int match_tcon(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
|
|||
return 0;
|
||||
if (tcon->nodelete != ctx->nodelete)
|
||||
return 0;
|
||||
if (tcon->posix_extensions != ctx->linux_ext)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1203,18 +1203,17 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data,
|
|||
goto out;
|
||||
}
|
||||
break;
|
||||
case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
cifs_create_junction_fattr(fattr, sb);
|
||||
rc = 0;
|
||||
goto out;
|
||||
default:
|
||||
/* Check for cached reparse point data */
|
||||
if (data->symlink_target || data->reparse.buf) {
|
||||
rc = 0;
|
||||
} else if (iov && server->ops->parse_reparse_point) {
|
||||
rc = server->ops->parse_reparse_point(cifs_sb,
|
||||
full_path,
|
||||
iov, data);
|
||||
} else if (iov && server->ops->get_reparse_point_buffer) {
|
||||
struct reparse_data_buffer *reparse_buf;
|
||||
u32 reparse_len;
|
||||
|
||||
reparse_buf = server->ops->get_reparse_point_buffer(iov, &reparse_len);
|
||||
rc = parse_reparse_point(reparse_buf, reparse_len,
|
||||
cifs_sb, full_path, data);
|
||||
/*
|
||||
* If the reparse point was not handled but it is the
|
||||
* name surrogate which points to directory, then treat
|
||||
|
|
@ -1228,6 +1227,16 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data,
|
|||
cifs_create_junction_fattr(fattr, sb);
|
||||
goto out;
|
||||
}
|
||||
/*
|
||||
* If the reparse point is unsupported by the Linux SMB
|
||||
* client then let it process by the SMB server. So mask
|
||||
* the -EOPNOTSUPP error code. This will allow Linux SMB
|
||||
* client to send SMB OPEN request to server. If server
|
||||
* does not support this reparse point too then server
|
||||
* will return error during open the path.
|
||||
*/
|
||||
if (rc == -EOPNOTSUPP)
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
if (data->reparse.tag == IO_REPARSE_TAG_SYMLINK && !rc) {
|
||||
|
|
|
|||
|
|
@ -542,12 +542,12 @@ static int wsl_set_reparse_buf(struct reparse_data_buffer **buf,
|
|||
kfree(symname_utf16);
|
||||
return -ENOMEM;
|
||||
}
|
||||
/* Flag 0x02000000 is unknown, but all wsl symlinks have this value */
|
||||
symlink_buf->Flags = cpu_to_le32(0x02000000);
|
||||
/* PathBuffer is in UTF-8 but without trailing null-term byte */
|
||||
/* Version field must be set to 2 (MS-FSCC 2.1.2.7) */
|
||||
symlink_buf->Version = cpu_to_le32(2);
|
||||
/* Target for Version 2 is in UTF-8 but without trailing null-term byte */
|
||||
symname_utf8_len = utf16s_to_utf8s((wchar_t *)symname_utf16, symname_utf16_len/2,
|
||||
UTF16_LITTLE_ENDIAN,
|
||||
symlink_buf->PathBuffer,
|
||||
symlink_buf->Target,
|
||||
symname_utf8_maxlen);
|
||||
*buf = (struct reparse_data_buffer *)symlink_buf;
|
||||
buf_len = sizeof(struct reparse_wsl_symlink_data_buffer) + symname_utf8_len;
|
||||
|
|
@ -1016,29 +1016,36 @@ static int parse_reparse_wsl_symlink(struct reparse_wsl_symlink_data_buffer *buf
|
|||
struct cifs_open_info_data *data)
|
||||
{
|
||||
int len = le16_to_cpu(buf->ReparseDataLength);
|
||||
int data_offset = offsetof(typeof(*buf), Target) - offsetof(typeof(*buf), Version);
|
||||
int symname_utf8_len;
|
||||
__le16 *symname_utf16;
|
||||
int symname_utf16_len;
|
||||
|
||||
if (len <= sizeof(buf->Flags)) {
|
||||
if (len <= data_offset) {
|
||||
cifs_dbg(VFS, "srv returned malformed wsl symlink buffer\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* PathBuffer is in UTF-8 but without trailing null-term byte */
|
||||
symname_utf8_len = len - sizeof(buf->Flags);
|
||||
/* MS-FSCC 2.1.2.7 defines layout of the Target field only for Version 2. */
|
||||
if (le32_to_cpu(buf->Version) != 2) {
|
||||
cifs_dbg(VFS, "srv returned unsupported wsl symlink version %u\n", le32_to_cpu(buf->Version));
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Target for Version 2 is in UTF-8 but without trailing null-term byte */
|
||||
symname_utf8_len = len - data_offset;
|
||||
/*
|
||||
* Check that buffer does not contain null byte
|
||||
* because Linux cannot process symlink with null byte.
|
||||
*/
|
||||
if (strnlen(buf->PathBuffer, symname_utf8_len) != symname_utf8_len) {
|
||||
if (strnlen(buf->Target, symname_utf8_len) != symname_utf8_len) {
|
||||
cifs_dbg(VFS, "srv returned null byte in wsl symlink target location\n");
|
||||
return -EIO;
|
||||
}
|
||||
symname_utf16 = kzalloc(symname_utf8_len * 2, GFP_KERNEL);
|
||||
if (!symname_utf16)
|
||||
return -ENOMEM;
|
||||
symname_utf16_len = utf8s_to_utf16s(buf->PathBuffer, symname_utf8_len,
|
||||
symname_utf16_len = utf8s_to_utf16s(buf->Target, symname_utf8_len,
|
||||
UTF16_LITTLE_ENDIAN,
|
||||
(wchar_t *) symname_utf16, symname_utf8_len * 2);
|
||||
if (symname_utf16_len < 0) {
|
||||
|
|
@ -1062,8 +1069,6 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
|
|||
const char *full_path,
|
||||
struct cifs_open_info_data *data)
|
||||
{
|
||||
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
|
||||
|
||||
data->reparse.buf = buf;
|
||||
|
||||
/* See MS-FSCC 2.1.2 */
|
||||
|
|
@ -1090,24 +1095,17 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
|
|||
}
|
||||
return 0;
|
||||
default:
|
||||
cifs_tcon_dbg(VFS | ONCE, "unhandled reparse tag: 0x%08x\n",
|
||||
le32_to_cpu(buf->ReparseTag));
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb,
|
||||
const char *full_path,
|
||||
struct kvec *rsp_iov,
|
||||
struct cifs_open_info_data *data)
|
||||
struct reparse_data_buffer *smb2_get_reparse_point_buffer(const struct kvec *rsp_iov,
|
||||
u32 *plen)
|
||||
{
|
||||
struct reparse_data_buffer *buf;
|
||||
struct smb2_ioctl_rsp *io = rsp_iov->iov_base;
|
||||
u32 plen = le32_to_cpu(io->OutputCount);
|
||||
|
||||
buf = (struct reparse_data_buffer *)((u8 *)io +
|
||||
le32_to_cpu(io->OutputOffset));
|
||||
return parse_reparse_point(buf, plen, cifs_sb, full_path, data);
|
||||
*plen = le32_to_cpu(io->OutputCount);
|
||||
return (struct reparse_data_buffer *)((u8 *)io +
|
||||
le32_to_cpu(io->OutputOffset));
|
||||
}
|
||||
|
||||
static bool wsl_to_fattr(struct cifs_open_info_data *data,
|
||||
|
|
@ -1233,16 +1231,6 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
|
|||
bool ok;
|
||||
|
||||
switch (tag) {
|
||||
case IO_REPARSE_TAG_INTERNAL:
|
||||
if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY))
|
||||
return false;
|
||||
fallthrough;
|
||||
case IO_REPARSE_TAG_DFS:
|
||||
case IO_REPARSE_TAG_DFSR:
|
||||
case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
/* See cifs_create_junction_fattr() */
|
||||
fattr->cf_mode = S_IFDIR | 0711;
|
||||
break;
|
||||
case IO_REPARSE_TAG_LX_SYMLINK:
|
||||
case IO_REPARSE_TAG_LX_FIFO:
|
||||
case IO_REPARSE_TAG_AF_UNIX:
|
||||
|
|
@ -1262,7 +1250,14 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
|
|||
fattr->cf_mode |= S_IFLNK;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY))
|
||||
return false;
|
||||
if (!IS_REPARSE_TAG_NAME_SURROGATE(tag) &&
|
||||
tag != IO_REPARSE_TAG_INTERNAL)
|
||||
return false;
|
||||
/* See cifs_create_junction_fattr() */
|
||||
fattr->cf_mode = S_IFDIR | 0711;
|
||||
break;
|
||||
}
|
||||
|
||||
fattr->cf_dtype = S_DT(fattr->cf_mode);
|
||||
|
|
|
|||
|
|
@ -135,9 +135,6 @@ int smb2_create_reparse_symlink(const unsigned int xid, struct inode *inode,
|
|||
int smb2_mknod_reparse(unsigned int xid, struct inode *inode,
|
||||
struct dentry *dentry, struct cifs_tcon *tcon,
|
||||
const char *full_path, umode_t mode, dev_t dev);
|
||||
int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb,
|
||||
const char *full_path,
|
||||
struct kvec *rsp_iov,
|
||||
struct cifs_open_info_data *data);
|
||||
struct reparse_data_buffer *smb2_get_reparse_point_buffer(const struct kvec *rsp_iov, u32 *len);
|
||||
|
||||
#endif /* _CIFS_REPARSE_H */
|
||||
|
|
|
|||
|
|
@ -680,6 +680,22 @@ unicode_oslm_strings(char **pbcc_area, const struct nls_table *nls_cp)
|
|||
*pbcc_area = bcc_ptr;
|
||||
}
|
||||
|
||||
static void
|
||||
ascii_oslm_strings(char **pbcc_area, const struct nls_table *nls_cp)
|
||||
{
|
||||
char *bcc_ptr = *pbcc_area;
|
||||
|
||||
strcpy(bcc_ptr, "Linux version ");
|
||||
bcc_ptr += strlen("Linux version ");
|
||||
strcpy(bcc_ptr, init_utsname()->release);
|
||||
bcc_ptr += strlen(init_utsname()->release) + 1;
|
||||
|
||||
strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
|
||||
bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
|
||||
|
||||
*pbcc_area = bcc_ptr;
|
||||
}
|
||||
|
||||
static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses,
|
||||
const struct nls_table *nls_cp)
|
||||
{
|
||||
|
|
@ -704,6 +720,25 @@ static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses,
|
|||
*pbcc_area = bcc_ptr;
|
||||
}
|
||||
|
||||
static void ascii_domain_string(char **pbcc_area, struct cifs_ses *ses,
|
||||
const struct nls_table *nls_cp)
|
||||
{
|
||||
char *bcc_ptr = *pbcc_area;
|
||||
int len;
|
||||
|
||||
/* copy domain */
|
||||
if (ses->domainName != NULL) {
|
||||
len = strscpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN);
|
||||
if (WARN_ON_ONCE(len < 0))
|
||||
len = CIFS_MAX_DOMAINNAME_LEN - 1;
|
||||
bcc_ptr += len;
|
||||
} /* else we send a null domain name so server will default to its own domain */
|
||||
*bcc_ptr = 0;
|
||||
bcc_ptr++;
|
||||
|
||||
*pbcc_area = bcc_ptr;
|
||||
}
|
||||
|
||||
static void unicode_ssetup_strings(char **pbcc_area, struct cifs_ses *ses,
|
||||
const struct nls_table *nls_cp)
|
||||
{
|
||||
|
|
@ -749,25 +784,10 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifs_ses *ses,
|
|||
*bcc_ptr = 0;
|
||||
bcc_ptr++; /* account for null termination */
|
||||
|
||||
/* copy domain */
|
||||
if (ses->domainName != NULL) {
|
||||
len = strscpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN);
|
||||
if (WARN_ON_ONCE(len < 0))
|
||||
len = CIFS_MAX_DOMAINNAME_LEN - 1;
|
||||
bcc_ptr += len;
|
||||
} /* else we send a null domain name so server will default to its own domain */
|
||||
*bcc_ptr = 0;
|
||||
bcc_ptr++;
|
||||
|
||||
/* BB check for overflow here */
|
||||
|
||||
strcpy(bcc_ptr, "Linux version ");
|
||||
bcc_ptr += strlen("Linux version ");
|
||||
strcpy(bcc_ptr, init_utsname()->release);
|
||||
bcc_ptr += strlen(init_utsname()->release) + 1;
|
||||
|
||||
strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
|
||||
bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
|
||||
ascii_domain_string(&bcc_ptr, ses, nls_cp);
|
||||
ascii_oslm_strings(&bcc_ptr, nls_cp);
|
||||
|
||||
*pbcc_area = bcc_ptr;
|
||||
}
|
||||
|
|
@ -1570,7 +1590,7 @@ sess_auth_kerberos(struct sess_data *sess_data)
|
|||
sess_data->iov[1].iov_len = msg->secblob_len;
|
||||
pSMB->req.SecurityBlobLength = cpu_to_le16(sess_data->iov[1].iov_len);
|
||||
|
||||
if (ses->capabilities & CAP_UNICODE) {
|
||||
if (pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) {
|
||||
/* unicode strings must be word aligned */
|
||||
if (!IS_ALIGNED(sess_data->iov[0].iov_len + sess_data->iov[1].iov_len, 2)) {
|
||||
*bcc_ptr = 0;
|
||||
|
|
@ -1579,8 +1599,8 @@ sess_auth_kerberos(struct sess_data *sess_data)
|
|||
unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp);
|
||||
unicode_domain_string(&bcc_ptr, ses, sess_data->nls_cp);
|
||||
} else {
|
||||
/* BB: is this right? */
|
||||
ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp);
|
||||
ascii_oslm_strings(&bcc_ptr, sess_data->nls_cp);
|
||||
ascii_domain_string(&bcc_ptr, ses, sess_data->nls_cp);
|
||||
}
|
||||
|
||||
sess_data->iov[2].iov_len = (long) bcc_ptr -
|
||||
|
|
|
|||
|
|
@ -568,6 +568,42 @@ static int cifs_query_path_info(const unsigned int xid,
|
|||
data->reparse_point = le32_to_cpu(fi.Attributes) & ATTR_REPARSE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CIFS_XATTR
|
||||
/*
|
||||
* For WSL CHR and BLK reparse points it is required to fetch
|
||||
* EA $LXDEV which contains major and minor device numbers.
|
||||
*/
|
||||
if (!rc && data->reparse_point) {
|
||||
struct smb2_file_full_ea_info *ea;
|
||||
|
||||
ea = (struct smb2_file_full_ea_info *)data->wsl.eas;
|
||||
rc = CIFSSMBQAllEAs(xid, tcon, full_path, SMB2_WSL_XATTR_DEV,
|
||||
&ea->ea_data[SMB2_WSL_XATTR_NAME_LEN + 1],
|
||||
SMB2_WSL_XATTR_DEV_SIZE, cifs_sb);
|
||||
if (rc == SMB2_WSL_XATTR_DEV_SIZE) {
|
||||
ea->next_entry_offset = cpu_to_le32(0);
|
||||
ea->flags = 0;
|
||||
ea->ea_name_length = SMB2_WSL_XATTR_NAME_LEN;
|
||||
ea->ea_value_length = cpu_to_le16(SMB2_WSL_XATTR_DEV_SIZE);
|
||||
memcpy(&ea->ea_data[0], SMB2_WSL_XATTR_DEV, SMB2_WSL_XATTR_NAME_LEN + 1);
|
||||
data->wsl.eas_len = sizeof(*ea) + SMB2_WSL_XATTR_NAME_LEN + 1 +
|
||||
SMB2_WSL_XATTR_DEV_SIZE;
|
||||
rc = 0;
|
||||
} else if (rc >= 0) {
|
||||
/* It is an error if EA $LXDEV has wrong size. */
|
||||
rc = -EINVAL;
|
||||
} else {
|
||||
/*
|
||||
* In all other cases ignore error if fetching
|
||||
* of EA $LXDEV failed. It is needed only for
|
||||
* WSL CHR and BLK reparse points and wsl_to_fattr()
|
||||
* handle the case when EA is missing.
|
||||
*/
|
||||
rc = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -970,18 +1006,13 @@ static int cifs_query_symlink(const unsigned int xid,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int cifs_parse_reparse_point(struct cifs_sb_info *cifs_sb,
|
||||
const char *full_path,
|
||||
struct kvec *rsp_iov,
|
||||
struct cifs_open_info_data *data)
|
||||
static struct reparse_data_buffer *cifs_get_reparse_point_buffer(const struct kvec *rsp_iov,
|
||||
u32 *plen)
|
||||
{
|
||||
struct reparse_data_buffer *buf;
|
||||
TRANSACT_IOCTL_RSP *io = rsp_iov->iov_base;
|
||||
u32 plen = le16_to_cpu(io->ByteCount);
|
||||
|
||||
buf = (struct reparse_data_buffer *)((__u8 *)&io->hdr.Protocol +
|
||||
le32_to_cpu(io->DataOffset));
|
||||
return parse_reparse_point(buf, plen, cifs_sb, full_path, data);
|
||||
*plen = le16_to_cpu(io->ByteCount);
|
||||
return (struct reparse_data_buffer *)((__u8 *)&io->hdr.Protocol +
|
||||
le32_to_cpu(io->DataOffset));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -1157,7 +1188,7 @@ struct smb_version_operations smb1_operations = {
|
|||
.rename = CIFSSMBRename,
|
||||
.create_hardlink = CIFSCreateHardLink,
|
||||
.query_symlink = cifs_query_symlink,
|
||||
.parse_reparse_point = cifs_parse_reparse_point,
|
||||
.get_reparse_point_buffer = cifs_get_reparse_point_buffer,
|
||||
.open = cifs_open_file,
|
||||
.set_fid = cifs_set_fid,
|
||||
.close = cifs_close_file,
|
||||
|
|
|
|||
|
|
@ -4555,9 +4555,9 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf,
|
|||
return rc;
|
||||
}
|
||||
} else {
|
||||
if (unlikely(!server->secmech.dec))
|
||||
return -EIO;
|
||||
|
||||
rc = smb3_crypto_aead_allocate(server);
|
||||
if (unlikely(rc))
|
||||
return rc;
|
||||
tfm = server->secmech.dec;
|
||||
}
|
||||
|
||||
|
|
@ -5303,7 +5303,7 @@ struct smb_version_operations smb20_operations = {
|
|||
.unlink = smb2_unlink,
|
||||
.rename = smb2_rename_path,
|
||||
.create_hardlink = smb2_create_hardlink,
|
||||
.parse_reparse_point = smb2_parse_reparse_point,
|
||||
.get_reparse_point_buffer = smb2_get_reparse_point_buffer,
|
||||
.query_mf_symlink = smb3_query_mf_symlink,
|
||||
.create_mf_symlink = smb3_create_mf_symlink,
|
||||
.create_reparse_symlink = smb2_create_reparse_symlink,
|
||||
|
|
@ -5406,7 +5406,7 @@ struct smb_version_operations smb21_operations = {
|
|||
.unlink = smb2_unlink,
|
||||
.rename = smb2_rename_path,
|
||||
.create_hardlink = smb2_create_hardlink,
|
||||
.parse_reparse_point = smb2_parse_reparse_point,
|
||||
.get_reparse_point_buffer = smb2_get_reparse_point_buffer,
|
||||
.query_mf_symlink = smb3_query_mf_symlink,
|
||||
.create_mf_symlink = smb3_create_mf_symlink,
|
||||
.create_reparse_symlink = smb2_create_reparse_symlink,
|
||||
|
|
@ -5513,7 +5513,7 @@ struct smb_version_operations smb30_operations = {
|
|||
.unlink = smb2_unlink,
|
||||
.rename = smb2_rename_path,
|
||||
.create_hardlink = smb2_create_hardlink,
|
||||
.parse_reparse_point = smb2_parse_reparse_point,
|
||||
.get_reparse_point_buffer = smb2_get_reparse_point_buffer,
|
||||
.query_mf_symlink = smb3_query_mf_symlink,
|
||||
.create_mf_symlink = smb3_create_mf_symlink,
|
||||
.create_reparse_symlink = smb2_create_reparse_symlink,
|
||||
|
|
@ -5629,7 +5629,7 @@ struct smb_version_operations smb311_operations = {
|
|||
.unlink = smb2_unlink,
|
||||
.rename = smb2_rename_path,
|
||||
.create_hardlink = smb2_create_hardlink,
|
||||
.parse_reparse_point = smb2_parse_reparse_point,
|
||||
.get_reparse_point_buffer = smb2_get_reparse_point_buffer,
|
||||
.query_mf_symlink = smb3_query_mf_symlink,
|
||||
.create_mf_symlink = smb3_create_mf_symlink,
|
||||
.create_reparse_symlink = smb2_create_reparse_symlink,
|
||||
|
|
|
|||
|
|
@ -1252,15 +1252,8 @@ SMB2_negotiate(const unsigned int xid,
|
|||
cifs_server_dbg(VFS, "Missing expected negotiate contexts\n");
|
||||
}
|
||||
|
||||
if (server->cipher_type && !rc) {
|
||||
if (!SERVER_IS_CHAN(server)) {
|
||||
rc = smb3_crypto_aead_allocate(server);
|
||||
} else {
|
||||
/* For channels, just reuse the primary server crypto secmech. */
|
||||
server->secmech.enc = server->primary_server->secmech.enc;
|
||||
server->secmech.dec = server->primary_server->secmech.dec;
|
||||
}
|
||||
}
|
||||
if (server->cipher_type && !rc)
|
||||
rc = smb3_crypto_aead_allocate(server);
|
||||
neg_exit:
|
||||
free_rsp_buf(resp_buftype, rsp);
|
||||
return rc;
|
||||
|
|
|
|||
|
|
@ -1567,13 +1567,13 @@ struct reparse_nfs_data_buffer {
|
|||
__u8 DataBuffer[];
|
||||
} __packed;
|
||||
|
||||
/* For IO_REPARSE_TAG_LX_SYMLINK */
|
||||
/* For IO_REPARSE_TAG_LX_SYMLINK - see MS-FSCC 2.1.2.7 */
|
||||
struct reparse_wsl_symlink_data_buffer {
|
||||
__le32 ReparseTag;
|
||||
__le16 ReparseDataLength;
|
||||
__u16 Reserved;
|
||||
__le32 Flags;
|
||||
__u8 PathBuffer[]; /* Variable Length UTF-8 string without nul-term */
|
||||
__le32 Version; /* Always 2 */
|
||||
__u8 Target[]; /* Variable Length UTF-8 string without nul-term */
|
||||
} __packed;
|
||||
|
||||
struct validate_negotiate_info_req {
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@
|
|||
#define FILE_SUPPORTS_ENCRYPTION 0x00020000
|
||||
#define FILE_SUPPORTS_OBJECT_IDS 0x00010000
|
||||
#define FILE_VOLUME_IS_COMPRESSED 0x00008000
|
||||
#define FILE_SUPPORTS_POSIX_UNLINK_RENAME 0x00000400
|
||||
#define FILE_RETURNS_CLEANUP_RESULT_INFO 0x00000200
|
||||
#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
|
||||
#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
|
||||
#define FILE_SUPPORTS_SPARSE_FILES 0x00000040
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user