Skip to content

Commit 379510a

Browse files
ZhangGuoDongsmfrench
authored andcommitted
smb/server: fix possible refcount leak in smb2_sess_setup()
Reference count of ksmbd_session will leak when session need reconnect. Fix this by adding the missing ksmbd_user_session_put(). Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 6fced05 commit 379510a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,7 @@ int smb2_sess_setup(struct ksmbd_work *work)
18061806

18071807
if (ksmbd_conn_need_reconnect(conn)) {
18081808
rc = -EFAULT;
1809+
ksmbd_user_session_put(sess);
18091810
sess = NULL;
18101811
goto out_err;
18111812
}

0 commit comments

Comments
 (0)