Commit 926028aa authored by Linus Torvalds's avatar Linus Torvalds

Merge tag '6.1-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:

 - two missing and one incorrect return value checks

 - fix leak on tlink mount failure

* tag '6.1-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: add check for returning value of SMB2_set_info_init
  cifs: Fix wrong return value checking when GETFLAGS
  cifs: add check for returning value of SMB2_close_init
  cifs: Fix connections leak when tlink setup failed
parents fe24a97c a51e5d29
...@@ -3855,9 +3855,13 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx) ...@@ -3855,9 +3855,13 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
uuid_copy(&cifs_sb->dfs_mount_id, &mnt_ctx.mount_id); uuid_copy(&cifs_sb->dfs_mount_id, &mnt_ctx.mount_id);
out: out:
free_xid(mnt_ctx.xid);
cifs_try_adding_channels(cifs_sb, mnt_ctx.ses); cifs_try_adding_channels(cifs_sb, mnt_ctx.ses);
return mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon);
if (rc)
goto error;
free_xid(mnt_ctx.xid);
return rc;
error: error:
dfs_cache_put_refsrv_sessions(&mnt_ctx.mount_id); dfs_cache_put_refsrv_sessions(&mnt_ctx.mount_id);
...@@ -3884,8 +3888,12 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx) ...@@ -3884,8 +3888,12 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
goto error; goto error;
} }
rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon);
if (rc)
goto error;
free_xid(mnt_ctx.xid); free_xid(mnt_ctx.xid);
return mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); return rc;
error: error:
mount_put_conns(&mnt_ctx); mount_put_conns(&mnt_ctx);
......
...@@ -343,7 +343,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -343,7 +343,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
rc = put_user(ExtAttrBits & rc = put_user(ExtAttrBits &
FS_FL_USER_VISIBLE, FS_FL_USER_VISIBLE,
(int __user *)arg); (int __user *)arg);
if (rc != EOPNOTSUPP) if (rc != -EOPNOTSUPP)
break; break;
} }
#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
...@@ -373,7 +373,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -373,7 +373,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
* pSMBFile->fid.netfid, * pSMBFile->fid.netfid,
* extAttrBits, * extAttrBits,
* &ExtAttrMask); * &ExtAttrMask);
* if (rc != EOPNOTSUPP) * if (rc != -EOPNOTSUPP)
* break; * break;
*/ */
......
...@@ -1116,6 +1116,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -1116,6 +1116,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
COMPOUND_FID, current->tgid, COMPOUND_FID, current->tgid,
FILE_FULL_EA_INFORMATION, FILE_FULL_EA_INFORMATION,
SMB2_O_INFO_FILE, 0, data, size); SMB2_O_INFO_FILE, 0, data, size);
if (rc)
goto sea_exit;
smb2_set_next_command(tcon, &rqst[1]); smb2_set_next_command(tcon, &rqst[1]);
smb2_set_related(&rqst[1]); smb2_set_related(&rqst[1]);
...@@ -1126,6 +1128,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -1126,6 +1128,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
rqst[2].rq_nvec = 1; rqst[2].rq_nvec = 1;
rc = SMB2_close_init(tcon, server, rc = SMB2_close_init(tcon, server,
&rqst[2], COMPOUND_FID, COMPOUND_FID, false); &rqst[2], COMPOUND_FID, COMPOUND_FID, false);
if (rc)
goto sea_exit;
smb2_set_related(&rqst[2]); smb2_set_related(&rqst[2]);
rc = compound_send_recv(xid, ses, server, rc = compound_send_recv(xid, ses, server,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment