Skip to content

Commit 09ba47b

Browse files
Paulo Alcantarasmfrench
authored andcommitted
cifs: prevent infinite recursion in CIFSGetDFSRefer()
We can't call smb_init() in CIFSGetDFSRefer() as cifs_reconnect_tcon() may end up calling CIFSGetDFSRefer() again to get new DFS referrals and thus causing an infinite recursion. Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Reviewed-by: Ronnie Sahlberg <[email protected]> Cc: [email protected] # 6.2 Signed-off-by: Steve French <[email protected]>
1 parent 6cc041e commit 09ba47b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

fs/cifs/cifssmb.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,8 +4382,13 @@ CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
43824382
return -ENODEV;
43834383

43844384
getDFSRetry:
4385-
rc = smb_init(SMB_COM_TRANSACTION2, 15, ses->tcon_ipc, (void **) &pSMB,
4386-
(void **) &pSMBr);
4385+
/*
4386+
* Use smb_init_no_reconnect() instead of smb_init() as
4387+
* CIFSGetDFSRefer() may be called from cifs_reconnect_tcon() and thus
4388+
* causing an infinite recursion.
4389+
*/
4390+
rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, ses->tcon_ipc,
4391+
(void **)&pSMB, (void **)&pSMBr);
43874392
if (rc)
43884393
return rc;
43894394

0 commit comments

Comments
 (0)