mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
cifs: Fix xid leak in cifs_get_file_info_unix()
commit10269f1325
upstream. If stardup the symlink target failed, should free the xid, otherwise the xid will be leaked. Fixes:76894f3e2f
("cifs: improve symlink handling for smb2+") Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
983ec6379b
commit
4d99a4c674
1 changed files with 4 additions and 2 deletions
|
@ -368,8 +368,10 @@ cifs_get_file_info_unix(struct file *filp)
|
|||
|
||||
if (cfile->symlink_target) {
|
||||
fattr.cf_symlink_target = kstrdup(cfile->symlink_target, GFP_KERNEL);
|
||||
if (!fattr.cf_symlink_target)
|
||||
return -ENOMEM;
|
||||
if (!fattr.cf_symlink_target) {
|
||||
rc = -ENOMEM;
|
||||
goto cifs_gfiunix_out;
|
||||
}
|
||||
}
|
||||
|
||||
rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->fid.netfid, &find_data);
|
||||
|
|
Loading…
Reference in a new issue