summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorZhangGuoDong <zhangguodong@kylinos.cn>2025-12-29 10:13:29 +0800
committerSteve French <stfrench@microsoft.com>2025-12-29 17:39:58 -0600
commit3296c3012a9d9a27e81e34910384e55a6ff3cff0 (patch)
tree4d468688db8a263f0d537fc69a516e2569868fbc /fs
parent7c28f8eef5ac5312794d8a52918076dcd787e53b (diff)
downloadlinux-3296c3012a9d9a27e81e34910384e55a6ff3cff0.tar.gz
linux-3296c3012a9d9a27e81e34910384e55a6ff3cff0.tar.bz2
linux-3296c3012a9d9a27e81e34910384e55a6ff3cff0.zip
smb/server: fix refcount leak in parse_durable_handle_context()
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/smb/server/smb2pdu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 8a7c48adb87e..ec9e4cd24c4c 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -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;
}