]> www.infradead.org Git - users/hch/misc.git/commitdiff
smb/server: fix possible refcount leak in smb2_sess_setup()
authorZhangGuoDong <zhangguodong@kylinos.cn>
Sat, 11 Oct 2025 16:51:36 +0000 (00:51 +0800)
committerSteve French <stfrench@microsoft.com>
Wed, 15 Oct 2025 11:03:09 +0000 (06:03 -0500)
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>
fs/smb/server/smb2pdu.c

index e81e615f322afbcfb6e5e45f4e238226a5cab77a..b731d9b094081c8e46abbd09641d7e85402c1d02 100644 (file)
@@ -1806,6 +1806,7 @@ int smb2_sess_setup(struct ksmbd_work *work)
 
                if (ksmbd_conn_need_reconnect(conn)) {
                        rc = -EFAULT;
+                       ksmbd_user_session_put(sess);
                        sess = NULL;
                        goto out_err;
                }