Skip to content

Commit 0fe0781

Browse files
Paulo Alcantarasmfrench
authored andcommitted
cifs: fix uninitialised lease_key in open_shroot()
SMB2_open_init() expects a pre-initialised lease_key when opening a file with a lease, so set pfid->lease_key prior to calling it in open_shroot(). This issue was observed when performing some DFS failover tests and the lease key was never randomly generated. Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]> Reviewed-by: Ronnie Sahlberg <[email protected]> Reviewed-by: Aurelien Aptel <[email protected]> CC: Stable <[email protected]>
1 parent 3786f4b commit 0fe0781

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/cifs/smb2ops.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,11 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon,
687687
if (smb3_encryption_required(tcon))
688688
flags |= CIFS_TRANSFORM_REQ;
689689

690+
if (!server->ops->new_lease_key)
691+
return -EIO;
692+
693+
server->ops->new_lease_key(pfid);
694+
690695
memset(rqst, 0, sizeof(rqst));
691696
resp_buftype[0] = resp_buftype[1] = CIFS_NO_BUFFER;
692697
memset(rsp_iov, 0, sizeof(rsp_iov));

0 commit comments

Comments
 (0)