Skip to content

Commit e20a405

Browse files
palismfrench
authored andcommitted
cifs: Do not attempt to call CIFSSMBRenameOpenFile() without CAP_INFOLEVEL_PASSTHRU
CIFSSMBRenameOpenFile() uses SMB_SET_FILE_RENAME_INFORMATION (0x3f2) level which is SMB PASSTHROUGH level (>= 0x03e8). SMB PASSTHROUGH levels are supported only when server announce CAP_INFOLEVEL_PASSTHRU. All usage of CIFSSMBRenameOpenFile() execept the one is already guarded by checks which prevents calling it against servers without support for CAP_INFOLEVEL_PASSTHRU. The remaning usage without guard is in cifs_do_rename() function, so add missing guard here. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4bda5f4 commit e20a405

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/smb/client/inode.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,6 +2392,13 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
23922392
if (to_dentry->d_parent != from_dentry->d_parent)
23932393
goto do_rename_exit;
23942394

2395+
/*
2396+
* CIFSSMBRenameOpenFile() uses SMB_SET_FILE_RENAME_INFORMATION
2397+
* which is SMB PASSTHROUGH level.
2398+
*/
2399+
if (!(tcon->ses->capabilities & CAP_INFOLEVEL_PASSTHRU))
2400+
goto do_rename_exit;
2401+
23952402
oparms = (struct cifs_open_parms) {
23962403
.tcon = tcon,
23972404
.cifs_sb = cifs_sb,

0 commit comments

Comments
 (0)