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 '4.19-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
"Three small SMB3 fixes, one for stable"

* tag '4.19-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6:
cifs: update internal module version number for cifs.ko to 2.12
cifs: check kmalloc before use
cifs: check if SMB2 PDU size has been padded and suppress the warning
cifs: create a define for how many iovs we need for an SMB2_open()

+30 -5
+1 -1
fs/cifs/cifsfs.h
··· 148 148 extern const struct export_operations cifs_export_ops; 149 149 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 150 150 151 - #define CIFS_VERSION "2.12" 151 + #define CIFS_VERSION "2.13" 152 152 #endif /* _CIFSFS_H */
+6
fs/cifs/sess.c
··· 398 398 goto setup_ntlmv2_ret; 399 399 } 400 400 *pbuffer = kmalloc(size_of_ntlmssp_blob(ses), GFP_KERNEL); 401 + if (!*pbuffer) { 402 + rc = -ENOMEM; 403 + cifs_dbg(VFS, "Error %d during NTLMSSP allocation\n", rc); 404 + *buflen = 0; 405 + goto setup_ntlmv2_ret; 406 + } 401 407 sec_blob = (AUTHENTICATE_MESSAGE *)*pbuffer; 402 408 403 409 memcpy(sec_blob->Signature, NTLMSSP_SIGNATURE, 8);
+7
fs/cifs/smb2misc.c
··· 238 238 return 0; 239 239 240 240 /* 241 + * Some windows servers (win2016) will pad also the final 242 + * PDU in a compound to 8 bytes. 243 + */ 244 + if (((clc_len + 7) & ~7) == len) 245 + return 0; 246 + 247 + /* 241 248 * MacOS server pads after SMB2.1 write response with 3 bytes 242 249 * of junk. Other servers match RFC1001 len to actual 243 250 * SMB2/SMB3 frame length (header + smb2 response specific data)
+2 -2
fs/cifs/smb2ops.c
··· 1582 1582 struct smb_rqst rqst[3]; 1583 1583 int resp_buftype[3]; 1584 1584 struct kvec rsp_iov[3]; 1585 - struct kvec open_iov[5]; /* 4 + potential padding. */ 1585 + struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; 1586 1586 struct kvec qi_iov[1]; 1587 1587 struct kvec close_iov[1]; 1588 1588 struct cifs_ses *ses = tcon->ses; ··· 1603 1603 1604 1604 memset(&open_iov, 0, sizeof(open_iov)); 1605 1605 rqst[0].rq_iov = open_iov; 1606 - rqst[0].rq_nvec = 4; 1606 + rqst[0].rq_nvec = SMB2_CREATE_IOV_SIZE; 1607 1607 1608 1608 oparms.tcon = tcon; 1609 1609 oparms.desired_access = FILE_READ_ATTRIBUTES;
+2 -2
fs/cifs/smb2pdu.c
··· 2256 2256 struct TCP_Server_Info *server; 2257 2257 struct cifs_tcon *tcon = oparms->tcon; 2258 2258 struct cifs_ses *ses = tcon->ses; 2259 - struct kvec iov[5]; /* make sure at least one for each open context */ 2259 + struct kvec iov[SMB2_CREATE_IOV_SIZE]; 2260 2260 struct kvec rsp_iov = {NULL, 0}; 2261 2261 int resp_buftype; 2262 2262 int rc = 0; ··· 2274 2274 memset(&rqst, 0, sizeof(struct smb_rqst)); 2275 2275 memset(&iov, 0, sizeof(iov)); 2276 2276 rqst.rq_iov = iov; 2277 - rqst.rq_nvec = 5; 2277 + rqst.rq_nvec = SMB2_CREATE_IOV_SIZE; 2278 2278 2279 2279 rc = SMB2_open_init(tcon, &rqst, oplock, oparms, path); 2280 2280 if (rc)
+12
fs/cifs/smb2pdu.h
··· 614 614 #define SMB2_CREATE_TAG_POSIX 0x93AD25509CB411E7B42383DE968BCD7C 615 615 616 616 617 + /* 618 + * Maximum number of iovs we need for an open/create request. 619 + * [0] : struct smb2_create_req 620 + * [1] : path 621 + * [2] : lease context 622 + * [3] : durable context 623 + * [4] : posix context 624 + * [5] : time warp context 625 + * [6] : compound padding 626 + */ 627 + #define SMB2_CREATE_IOV_SIZE 7 628 + 617 629 struct smb2_create_req { 618 630 struct smb2_sync_hdr sync_hdr; 619 631 __le16 StructureSize; /* Must be 57 */