Files
linux/fs
Shuhao Fu fbb9ccd574 smb: client: fix refcount leak in smb2_set_path_attr
[ Upstream commit b540de9e3b ]

Fix refcount leak in `smb2_set_path_attr` when path conversion fails.

Function `cifs_get_writable_path` returns `cfile` with its reference
counter `cfile->count` increased on success. Function `smb2_compound_op`
would decrease the reference counter for `cfile`, as stated in its
comment. By calling `smb2_rename_path`, the reference counter of `cfile`
would leak if `cifs_convert_path_to_utf16` fails in `smb2_set_path_attr`.

Fixes: 8de9e86c67 ("cifs: create a helper to find a writeable handle by path name")
Acked-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Shuhao Fu <sfual@cse.ust.hk>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-11-24 10:35:45 +01:00
..
2025-07-10 16:05:08 +02:00
2024-10-17 00:28:06 -07:00
2025-10-12 12:57:17 +02:00
2025-01-23 17:22:55 +01:00
2024-08-21 22:32:58 +02:00
2025-03-22 12:54:15 -07:00
2025-10-29 14:08:51 +01:00
2024-12-05 14:02:47 +01:00
2025-07-10 16:05:08 +02:00
2024-08-28 13:05:39 +02:00
2025-01-17 13:40:50 +01:00
2024-09-27 08:18:43 -07:00
2024-09-27 08:18:43 -07:00
2025-06-27 11:11:36 +01:00