Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

smb/server: fix refcount leak in smb2_open()

When ksmbd_vfs_getattr() fails, the reference count of ksmbd_file
must be released.

Suggested-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

ZhangGuoDong and committed by
Steve French
f416c556 3296c301

+1 -1
+1 -1
fs/smb/server/smb2pdu.c
··· 3010 3010 file_info = FILE_OPENED; 3011 3011 3012 3012 rc = ksmbd_vfs_getattr(&fp->filp->f_path, &stat); 3013 + ksmbd_put_durable_fd(fp); 3013 3014 if (rc) 3014 3015 goto err_out2; 3015 3016 3016 - ksmbd_put_durable_fd(fp); 3017 3017 goto reconnected_fp; 3018 3018 } 3019 3019 } else if (req_op_level == SMB2_OPLOCK_LEVEL_LEASE)