Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+154 -111
+5 -11
fs/smb/client/cifsencrypt.c
··· 704 704 cifs_free_hash(&server->secmech.md5); 705 705 cifs_free_hash(&server->secmech.sha512); 706 706 707 - if (!SERVER_IS_CHAN(server)) { 708 - if (server->secmech.enc) { 709 - crypto_free_aead(server->secmech.enc); 710 - server->secmech.enc = NULL; 711 - } 712 - 713 - if (server->secmech.dec) { 714 - crypto_free_aead(server->secmech.dec); 715 - server->secmech.dec = NULL; 716 - } 717 - } else { 707 + if (server->secmech.enc) { 708 + crypto_free_aead(server->secmech.enc); 718 709 server->secmech.enc = NULL; 710 + } 711 + if (server->secmech.dec) { 712 + crypto_free_aead(server->secmech.dec); 719 713 server->secmech.dec = NULL; 720 714 } 721 715 }
+2 -4
fs/smb/client/cifsglob.h
··· 625 625 bool (*is_status_io_timeout)(char *buf); 626 626 /* Check for STATUS_NETWORK_NAME_DELETED */ 627 627 bool (*is_network_name_deleted)(char *buf, struct TCP_Server_Info *srv); 628 - int (*parse_reparse_point)(struct cifs_sb_info *cifs_sb, 629 - const char *full_path, 630 - struct kvec *rsp_iov, 631 - struct cifs_open_info_data *data); 628 + struct reparse_data_buffer * (*get_reparse_point_buffer)(const struct kvec *rsp_iov, 629 + u32 *plen); 632 630 int (*create_reparse_symlink)(const unsigned int xid, 633 631 struct inode *inode, 634 632 struct dentry *dentry,
+2
fs/smb/client/cifspdu.h
··· 2256 2256 #define FILE_SUPPORTS_ENCRYPTION 0x00020000 2257 2257 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000 2258 2258 #define FILE_VOLUME_IS_COMPRESSED 0x00008000 2259 + #define FILE_SUPPORTS_POSIX_UNLINK_RENAME 0x00000400 2260 + #define FILE_RETURNS_CLEANUP_RESULT_INFO 0x00000200 2259 2261 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 2260 2262 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 2261 2263 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
+2
fs/smb/client/connect.c
··· 2556 2556 return 0; 2557 2557 if (tcon->nodelete != ctx->nodelete) 2558 2558 return 0; 2559 + if (tcon->posix_extensions != ctx->linux_ext) 2560 + return 0; 2559 2561 return 1; 2560 2562 } 2561 2563
+17 -8
fs/smb/client/inode.c
··· 1203 1203 goto out; 1204 1204 } 1205 1205 break; 1206 - case IO_REPARSE_TAG_MOUNT_POINT: 1207 - cifs_create_junction_fattr(fattr, sb); 1208 - rc = 0; 1209 - goto out; 1210 1206 default: 1211 1207 /* Check for cached reparse point data */ 1212 1208 if (data->symlink_target || data->reparse.buf) { 1213 1209 rc = 0; 1214 - } else if (iov && server->ops->parse_reparse_point) { 1215 - rc = server->ops->parse_reparse_point(cifs_sb, 1216 - full_path, 1217 - iov, data); 1210 + } else if (iov && server->ops->get_reparse_point_buffer) { 1211 + struct reparse_data_buffer *reparse_buf; 1212 + u32 reparse_len; 1213 + 1214 + reparse_buf = server->ops->get_reparse_point_buffer(iov, &reparse_len); 1215 + rc = parse_reparse_point(reparse_buf, reparse_len, 1216 + cifs_sb, full_path, data); 1218 1217 /* 1219 1218 * If the reparse point was not handled but it is the 1220 1219 * name surrogate which points to directory, then treat ··· 1227 1228 cifs_create_junction_fattr(fattr, sb); 1228 1229 goto out; 1229 1230 } 1231 + /* 1232 + * If the reparse point is unsupported by the Linux SMB 1233 + * client then let it process by the SMB server. So mask 1234 + * the -EOPNOTSUPP error code. This will allow Linux SMB 1235 + * client to send SMB OPEN request to server. If server 1236 + * does not support this reparse point too then server 1237 + * will return error during open the path. 1238 + */ 1239 + if (rc == -EOPNOTSUPP) 1240 + rc = 0; 1230 1241 } 1231 1242 1232 1243 if (data->reparse.tag == IO_REPARSE_TAG_SYMLINK && !rc) {
+29 -34
fs/smb/client/reparse.c
··· 542 542 kfree(symname_utf16); 543 543 return -ENOMEM; 544 544 } 545 - /* Flag 0x02000000 is unknown, but all wsl symlinks have this value */ 546 - symlink_buf->Flags = cpu_to_le32(0x02000000); 547 - /* PathBuffer is in UTF-8 but without trailing null-term byte */ 545 + /* Version field must be set to 2 (MS-FSCC 2.1.2.7) */ 546 + symlink_buf->Version = cpu_to_le32(2); 547 + /* Target for Version 2 is in UTF-8 but without trailing null-term byte */ 548 548 symname_utf8_len = utf16s_to_utf8s((wchar_t *)symname_utf16, symname_utf16_len/2, 549 549 UTF16_LITTLE_ENDIAN, 550 - symlink_buf->PathBuffer, 550 + symlink_buf->Target, 551 551 symname_utf8_maxlen); 552 552 *buf = (struct reparse_data_buffer *)symlink_buf; 553 553 buf_len = sizeof(struct reparse_wsl_symlink_data_buffer) + symname_utf8_len; ··· 1016 1016 struct cifs_open_info_data *data) 1017 1017 { 1018 1018 int len = le16_to_cpu(buf->ReparseDataLength); 1019 + int data_offset = offsetof(typeof(*buf), Target) - offsetof(typeof(*buf), Version); 1019 1020 int symname_utf8_len; 1020 1021 __le16 *symname_utf16; 1021 1022 int symname_utf16_len; 1022 1023 1023 - if (len <= sizeof(buf->Flags)) { 1024 + if (len <= data_offset) { 1024 1025 cifs_dbg(VFS, "srv returned malformed wsl symlink buffer\n"); 1025 1026 return -EIO; 1026 1027 } 1027 1028 1028 - /* PathBuffer is in UTF-8 but without trailing null-term byte */ 1029 - symname_utf8_len = len - sizeof(buf->Flags); 1029 + /* MS-FSCC 2.1.2.7 defines layout of the Target field only for Version 2. */ 1030 + if (le32_to_cpu(buf->Version) != 2) { 1031 + cifs_dbg(VFS, "srv returned unsupported wsl symlink version %u\n", le32_to_cpu(buf->Version)); 1032 + return -EIO; 1033 + } 1034 + 1035 + /* Target for Version 2 is in UTF-8 but without trailing null-term byte */ 1036 + symname_utf8_len = len - data_offset; 1030 1037 /* 1031 1038 * Check that buffer does not contain null byte 1032 1039 * because Linux cannot process symlink with null byte. 1033 1040 */ 1034 - if (strnlen(buf->PathBuffer, symname_utf8_len) != symname_utf8_len) { 1041 + if (strnlen(buf->Target, symname_utf8_len) != symname_utf8_len) { 1035 1042 cifs_dbg(VFS, "srv returned null byte in wsl symlink target location\n"); 1036 1043 return -EIO; 1037 1044 } 1038 1045 symname_utf16 = kzalloc(symname_utf8_len * 2, GFP_KERNEL); 1039 1046 if (!symname_utf16) 1040 1047 return -ENOMEM; 1041 - symname_utf16_len = utf8s_to_utf16s(buf->PathBuffer, symname_utf8_len, 1048 + symname_utf16_len = utf8s_to_utf16s(buf->Target, symname_utf8_len, 1042 1049 UTF16_LITTLE_ENDIAN, 1043 1050 (wchar_t *) symname_utf16, symname_utf8_len * 2); 1044 1051 if (symname_utf16_len < 0) { ··· 1069 1062 const char *full_path, 1070 1063 struct cifs_open_info_data *data) 1071 1064 { 1072 - struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 1073 - 1074 1065 data->reparse.buf = buf; 1075 1066 1076 1067 /* See MS-FSCC 2.1.2 */ ··· 1095 1090 } 1096 1091 return 0; 1097 1092 default: 1098 - cifs_tcon_dbg(VFS | ONCE, "unhandled reparse tag: 0x%08x\n", 1099 - le32_to_cpu(buf->ReparseTag)); 1100 1093 return -EOPNOTSUPP; 1101 1094 } 1102 1095 } 1103 1096 1104 - int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb, 1105 - const char *full_path, 1106 - struct kvec *rsp_iov, 1107 - struct cifs_open_info_data *data) 1097 + struct reparse_data_buffer *smb2_get_reparse_point_buffer(const struct kvec *rsp_iov, 1098 + u32 *plen) 1108 1099 { 1109 - struct reparse_data_buffer *buf; 1110 1100 struct smb2_ioctl_rsp *io = rsp_iov->iov_base; 1111 - u32 plen = le32_to_cpu(io->OutputCount); 1112 - 1113 - buf = (struct reparse_data_buffer *)((u8 *)io + 1114 - le32_to_cpu(io->OutputOffset)); 1115 - return parse_reparse_point(buf, plen, cifs_sb, full_path, data); 1101 + *plen = le32_to_cpu(io->OutputCount); 1102 + return (struct reparse_data_buffer *)((u8 *)io + 1103 + le32_to_cpu(io->OutputOffset)); 1116 1104 } 1117 1105 1118 1106 static bool wsl_to_fattr(struct cifs_open_info_data *data, ··· 1231 1233 bool ok; 1232 1234 1233 1235 switch (tag) { 1234 - case IO_REPARSE_TAG_INTERNAL: 1235 - if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY)) 1236 - return false; 1237 - fallthrough; 1238 - case IO_REPARSE_TAG_DFS: 1239 - case IO_REPARSE_TAG_DFSR: 1240 - case IO_REPARSE_TAG_MOUNT_POINT: 1241 - /* See cifs_create_junction_fattr() */ 1242 - fattr->cf_mode = S_IFDIR | 0711; 1243 - break; 1244 1236 case IO_REPARSE_TAG_LX_SYMLINK: 1245 1237 case IO_REPARSE_TAG_LX_FIFO: 1246 1238 case IO_REPARSE_TAG_AF_UNIX: ··· 1250 1262 fattr->cf_mode |= S_IFLNK; 1251 1263 break; 1252 1264 default: 1253 - return false; 1265 + if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY)) 1266 + return false; 1267 + if (!IS_REPARSE_TAG_NAME_SURROGATE(tag) && 1268 + tag != IO_REPARSE_TAG_INTERNAL) 1269 + return false; 1270 + /* See cifs_create_junction_fattr() */ 1271 + fattr->cf_mode = S_IFDIR | 0711; 1272 + break; 1254 1273 } 1255 1274 1256 1275 fattr->cf_dtype = S_DT(fattr->cf_mode);
+1 -4
fs/smb/client/reparse.h
··· 135 135 int smb2_mknod_reparse(unsigned int xid, struct inode *inode, 136 136 struct dentry *dentry, struct cifs_tcon *tcon, 137 137 const char *full_path, umode_t mode, dev_t dev); 138 - int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb, 139 - const char *full_path, 140 - struct kvec *rsp_iov, 141 - struct cifs_open_info_data *data); 138 + struct reparse_data_buffer *smb2_get_reparse_point_buffer(const struct kvec *rsp_iov, u32 *len); 142 139 143 140 #endif /* _CIFS_REPARSE_H */
+40 -20
fs/smb/client/sess.c
··· 680 680 *pbcc_area = bcc_ptr; 681 681 } 682 682 683 + static void 684 + ascii_oslm_strings(char **pbcc_area, const struct nls_table *nls_cp) 685 + { 686 + char *bcc_ptr = *pbcc_area; 687 + 688 + strcpy(bcc_ptr, "Linux version "); 689 + bcc_ptr += strlen("Linux version "); 690 + strcpy(bcc_ptr, init_utsname()->release); 691 + bcc_ptr += strlen(init_utsname()->release) + 1; 692 + 693 + strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); 694 + bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; 695 + 696 + *pbcc_area = bcc_ptr; 697 + } 698 + 683 699 static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses, 684 700 const struct nls_table *nls_cp) 685 701 { ··· 716 700 CIFS_MAX_DOMAINNAME_LEN, nls_cp); 717 701 bcc_ptr += 2 * bytes_ret; 718 702 bcc_ptr += 2; /* account for null terminator */ 703 + 704 + *pbcc_area = bcc_ptr; 705 + } 706 + 707 + static void ascii_domain_string(char **pbcc_area, struct cifs_ses *ses, 708 + const struct nls_table *nls_cp) 709 + { 710 + char *bcc_ptr = *pbcc_area; 711 + int len; 712 + 713 + /* copy domain */ 714 + if (ses->domainName != NULL) { 715 + len = strscpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN); 716 + if (WARN_ON_ONCE(len < 0)) 717 + len = CIFS_MAX_DOMAINNAME_LEN - 1; 718 + bcc_ptr += len; 719 + } /* else we send a null domain name so server will default to its own domain */ 720 + *bcc_ptr = 0; 721 + bcc_ptr++; 719 722 720 723 *pbcc_area = bcc_ptr; 721 724 } ··· 784 749 *bcc_ptr = 0; 785 750 bcc_ptr++; /* account for null termination */ 786 751 787 - /* copy domain */ 788 - if (ses->domainName != NULL) { 789 - len = strscpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN); 790 - if (WARN_ON_ONCE(len < 0)) 791 - len = CIFS_MAX_DOMAINNAME_LEN - 1; 792 - bcc_ptr += len; 793 - } /* else we send a null domain name so server will default to its own domain */ 794 - *bcc_ptr = 0; 795 - bcc_ptr++; 796 - 797 752 /* BB check for overflow here */ 798 753 799 - strcpy(bcc_ptr, "Linux version "); 800 - bcc_ptr += strlen("Linux version "); 801 - strcpy(bcc_ptr, init_utsname()->release); 802 - bcc_ptr += strlen(init_utsname()->release) + 1; 803 - 804 - strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); 805 - bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; 754 + ascii_domain_string(&bcc_ptr, ses, nls_cp); 755 + ascii_oslm_strings(&bcc_ptr, nls_cp); 806 756 807 757 *pbcc_area = bcc_ptr; 808 758 } ··· 1590 1570 sess_data->iov[1].iov_len = msg->secblob_len; 1591 1571 pSMB->req.SecurityBlobLength = cpu_to_le16(sess_data->iov[1].iov_len); 1592 1572 1593 - if (ses->capabilities & CAP_UNICODE) { 1573 + if (pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) { 1594 1574 /* unicode strings must be word aligned */ 1595 1575 if (!IS_ALIGNED(sess_data->iov[0].iov_len + sess_data->iov[1].iov_len, 2)) { 1596 1576 *bcc_ptr = 0; ··· 1599 1579 unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp); 1600 1580 unicode_domain_string(&bcc_ptr, ses, sess_data->nls_cp); 1601 1581 } else { 1602 - /* BB: is this right? */ 1603 - ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); 1582 + ascii_oslm_strings(&bcc_ptr, sess_data->nls_cp); 1583 + ascii_domain_string(&bcc_ptr, ses, sess_data->nls_cp); 1604 1584 } 1605 1585 1606 1586 sess_data->iov[2].iov_len = (long) bcc_ptr -
+42 -11
fs/smb/client/smb1ops.c
··· 568 568 data->reparse_point = le32_to_cpu(fi.Attributes) & ATTR_REPARSE; 569 569 } 570 570 571 + #ifdef CONFIG_CIFS_XATTR 572 + /* 573 + * For WSL CHR and BLK reparse points it is required to fetch 574 + * EA $LXDEV which contains major and minor device numbers. 575 + */ 576 + if (!rc && data->reparse_point) { 577 + struct smb2_file_full_ea_info *ea; 578 + 579 + ea = (struct smb2_file_full_ea_info *)data->wsl.eas; 580 + rc = CIFSSMBQAllEAs(xid, tcon, full_path, SMB2_WSL_XATTR_DEV, 581 + &ea->ea_data[SMB2_WSL_XATTR_NAME_LEN + 1], 582 + SMB2_WSL_XATTR_DEV_SIZE, cifs_sb); 583 + if (rc == SMB2_WSL_XATTR_DEV_SIZE) { 584 + ea->next_entry_offset = cpu_to_le32(0); 585 + ea->flags = 0; 586 + ea->ea_name_length = SMB2_WSL_XATTR_NAME_LEN; 587 + ea->ea_value_length = cpu_to_le16(SMB2_WSL_XATTR_DEV_SIZE); 588 + memcpy(&ea->ea_data[0], SMB2_WSL_XATTR_DEV, SMB2_WSL_XATTR_NAME_LEN + 1); 589 + data->wsl.eas_len = sizeof(*ea) + SMB2_WSL_XATTR_NAME_LEN + 1 + 590 + SMB2_WSL_XATTR_DEV_SIZE; 591 + rc = 0; 592 + } else if (rc >= 0) { 593 + /* It is an error if EA $LXDEV has wrong size. */ 594 + rc = -EINVAL; 595 + } else { 596 + /* 597 + * In all other cases ignore error if fetching 598 + * of EA $LXDEV failed. It is needed only for 599 + * WSL CHR and BLK reparse points and wsl_to_fattr() 600 + * handle the case when EA is missing. 601 + */ 602 + rc = 0; 603 + } 604 + } 605 + #endif 606 + 571 607 return rc; 572 608 } 573 609 ··· 1006 970 return rc; 1007 971 } 1008 972 1009 - static int cifs_parse_reparse_point(struct cifs_sb_info *cifs_sb, 1010 - const char *full_path, 1011 - struct kvec *rsp_iov, 1012 - struct cifs_open_info_data *data) 973 + static struct reparse_data_buffer *cifs_get_reparse_point_buffer(const struct kvec *rsp_iov, 974 + u32 *plen) 1013 975 { 1014 - struct reparse_data_buffer *buf; 1015 976 TRANSACT_IOCTL_RSP *io = rsp_iov->iov_base; 1016 - u32 plen = le16_to_cpu(io->ByteCount); 1017 - 1018 - buf = (struct reparse_data_buffer *)((__u8 *)&io->hdr.Protocol + 1019 - le32_to_cpu(io->DataOffset)); 1020 - return parse_reparse_point(buf, plen, cifs_sb, full_path, data); 977 + *plen = le16_to_cpu(io->ByteCount); 978 + return (struct reparse_data_buffer *)((__u8 *)&io->hdr.Protocol + 979 + le32_to_cpu(io->DataOffset)); 1021 980 } 1022 981 1023 982 static bool ··· 1188 1157 .rename = CIFSSMBRename, 1189 1158 .create_hardlink = CIFSCreateHardLink, 1190 1159 .query_symlink = cifs_query_symlink, 1191 - .parse_reparse_point = cifs_parse_reparse_point, 1160 + .get_reparse_point_buffer = cifs_get_reparse_point_buffer, 1192 1161 .open = cifs_open_file, 1193 1162 .set_fid = cifs_set_fid, 1194 1163 .close = cifs_close_file,
+7 -7
fs/smb/client/smb2ops.c
··· 4555 4555 return rc; 4556 4556 } 4557 4557 } else { 4558 - if (unlikely(!server->secmech.dec)) 4559 - return -EIO; 4560 - 4558 + rc = smb3_crypto_aead_allocate(server); 4559 + if (unlikely(rc)) 4560 + return rc; 4561 4561 tfm = server->secmech.dec; 4562 4562 } 4563 4563 ··· 5303 5303 .unlink = smb2_unlink, 5304 5304 .rename = smb2_rename_path, 5305 5305 .create_hardlink = smb2_create_hardlink, 5306 - .parse_reparse_point = smb2_parse_reparse_point, 5306 + .get_reparse_point_buffer = smb2_get_reparse_point_buffer, 5307 5307 .query_mf_symlink = smb3_query_mf_symlink, 5308 5308 .create_mf_symlink = smb3_create_mf_symlink, 5309 5309 .create_reparse_symlink = smb2_create_reparse_symlink, ··· 5406 5406 .unlink = smb2_unlink, 5407 5407 .rename = smb2_rename_path, 5408 5408 .create_hardlink = smb2_create_hardlink, 5409 - .parse_reparse_point = smb2_parse_reparse_point, 5409 + .get_reparse_point_buffer = smb2_get_reparse_point_buffer, 5410 5410 .query_mf_symlink = smb3_query_mf_symlink, 5411 5411 .create_mf_symlink = smb3_create_mf_symlink, 5412 5412 .create_reparse_symlink = smb2_create_reparse_symlink, ··· 5513 5513 .unlink = smb2_unlink, 5514 5514 .rename = smb2_rename_path, 5515 5515 .create_hardlink = smb2_create_hardlink, 5516 - .parse_reparse_point = smb2_parse_reparse_point, 5516 + .get_reparse_point_buffer = smb2_get_reparse_point_buffer, 5517 5517 .query_mf_symlink = smb3_query_mf_symlink, 5518 5518 .create_mf_symlink = smb3_create_mf_symlink, 5519 5519 .create_reparse_symlink = smb2_create_reparse_symlink, ··· 5629 5629 .unlink = smb2_unlink, 5630 5630 .rename = smb2_rename_path, 5631 5631 .create_hardlink = smb2_create_hardlink, 5632 - .parse_reparse_point = smb2_parse_reparse_point, 5632 + .get_reparse_point_buffer = smb2_get_reparse_point_buffer, 5633 5633 .query_mf_symlink = smb3_query_mf_symlink, 5634 5634 .create_mf_symlink = smb3_create_mf_symlink, 5635 5635 .create_reparse_symlink = smb2_create_reparse_symlink,
+2 -9
fs/smb/client/smb2pdu.c
··· 1252 1252 cifs_server_dbg(VFS, "Missing expected negotiate contexts\n"); 1253 1253 } 1254 1254 1255 - if (server->cipher_type && !rc) { 1256 - if (!SERVER_IS_CHAN(server)) { 1257 - rc = smb3_crypto_aead_allocate(server); 1258 - } else { 1259 - /* For channels, just reuse the primary server crypto secmech. */ 1260 - server->secmech.enc = server->primary_server->secmech.enc; 1261 - server->secmech.dec = server->primary_server->secmech.dec; 1262 - } 1263 - } 1255 + if (server->cipher_type && !rc) 1256 + rc = smb3_crypto_aead_allocate(server); 1264 1257 neg_exit: 1265 1258 free_rsp_buf(resp_buftype, rsp); 1266 1259 return rc;
+3 -3
fs/smb/common/smb2pdu.h
··· 1567 1567 __u8 DataBuffer[]; 1568 1568 } __packed; 1569 1569 1570 - /* For IO_REPARSE_TAG_LX_SYMLINK */ 1570 + /* For IO_REPARSE_TAG_LX_SYMLINK - see MS-FSCC 2.1.2.7 */ 1571 1571 struct reparse_wsl_symlink_data_buffer { 1572 1572 __le32 ReparseTag; 1573 1573 __le16 ReparseDataLength; 1574 1574 __u16 Reserved; 1575 - __le32 Flags; 1576 - __u8 PathBuffer[]; /* Variable Length UTF-8 string without nul-term */ 1575 + __le32 Version; /* Always 2 */ 1576 + __u8 Target[]; /* Variable Length UTF-8 string without nul-term */ 1577 1577 } __packed; 1578 1578 1579 1579 struct validate_negotiate_info_req {
+2
fs/smb/server/smb_common.h
··· 72 72 #define FILE_SUPPORTS_ENCRYPTION 0x00020000 73 73 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000 74 74 #define FILE_VOLUME_IS_COMPRESSED 0x00008000 75 + #define FILE_SUPPORTS_POSIX_UNLINK_RENAME 0x00000400 76 + #define FILE_RETURNS_CLEANUP_RESULT_INFO 0x00000200 75 77 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 76 78 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 77 79 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040