]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb/server: fix refcount leak in parse_durable_handle_context()
authorZhangGuoDong <zhangguodong@kylinos.cn>
Mon, 29 Dec 2025 02:13:29 +0000 (10:13 +0800)
committerSteve French <stfrench@microsoft.com>
Mon, 29 Dec 2025 23:39:58 +0000 (17:39 -0600)
When the command is a replay operation and -ENOEXEC is returned,
the refcount of ksmbd_file must be released.

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>
fs/smb/server/smb2pdu.c

index 8a7c48adb87e6c93903702f7775e6f18f5e217c2..ec9e4cd24c4cb1a1b780b256605565c692ee5af4 100644 (file)
@@ -2812,6 +2812,7 @@ static int parse_durable_handle_context(struct ksmbd_work *work,
                                            SMB2_CLIENT_GUID_SIZE)) {
                                        if (!(req->hdr.Flags & SMB2_FLAGS_REPLAY_OPERATION)) {
                                                err = -ENOEXEC;
+                                               ksmbd_put_durable_fd(dh_info->fp);
                                                goto out;
                                        }