Files
linux-stable-mirror/fs
Guenter RoeckandGreg Kroah-Hartman 2f91ef68d0 smb/server: Fix another refcount leak in smb2_open()
[ Upstream commit c15e7c62fe ]

If ksmbd_override_fsids() fails, we jump to err_out2. At that point, fp is
NULL because it hasn't been assigned dh_info.fp yet, so ksmbd_fd_put(work,
fp) will not be called. However, dh_info.fp was already inserted into the
session file table by ksmbd_reopen_durable_fd(), so it will leak in the
session file table until the session is closed.

Move fp = dh_info.fp; ahead of the ksmbd_override_fsids() check to fix the
problem.

Found by an experimental AI code review agent at Google.

Fixes: c8efcc7861 ("ksmbd: add support for durable handles v1/v2")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-03-25 11:05:45 +01:00
..
2026-01-11 15:22:23 +01:00
2026-03-04 07:20:32 -05:00
2026-03-04 07:20:43 -05:00
2026-01-11 15:22:23 +01:00
2026-01-17 16:30:00 +01:00
2025-03-22 12:50:41 -07:00
2026-03-04 07:21:11 -05:00
2025-10-29 14:06:59 +01:00
2026-01-11 15:22:23 +01:00
2025-06-27 11:08:57 +01:00