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) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com> CC: Stable <stable@vger.kernel.org>
1 parent 3786f4b commit 0fe0781

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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)