linux/fs/cifs
Shuhao Fu d3c8ea1970 smb: client: Fix refcount leak for cifs_sb_tlink
[ Upstream commit c2b77f4220 ]

Fix three refcount inconsistency issues related to `cifs_sb_tlink`.

Comments for `cifs_sb_tlink` state that `cifs_put_tlink()` needs to be
called after successful calls to `cifs_sb_tlink()`. Three calls fail to
update refcount accordingly, leading to possible resource leaks.

Fixes: 8ceb984379 ("CIFS: Move rename to ops struct")
Fixes: 2f1afe2599 ("cifs: Use smb 2 - 3 and cifsacl mount options getacl functions")
Fixes: 366ed846df ("cifs: Use smb 2 - 3 and cifsacl mount options setacl function")
Cc: stable@vger.kernel.org
Signed-off-by: Shuhao Fu <sfual@cse.ust.hk>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Johnny Hao <johnny_haocn@sina.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-04-18 10:33:35 +02:00
..
asn1.c cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
cache.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_debug.c smb: client: fix potential UAF in cifs_stats_proc_show() 2025-05-02 07:44:21 +02:00
cifs_debug.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_dfs_ref.c smb: client: set correct id, uid and cruid for multiuser automounts 2026-02-19 16:21:45 +01:00
cifs_fs_sb.h cifs: support nested dfs links over reconnect 2022-12-02 17:40:59 +01:00
cifs_ioctl.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_spnego.c cifs: spnego: add ';' in HOST_KEY_LEN 2023-11-28 16:56:25 +00:00
cifs_spnego.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_spnego_negtokeninit.asn1 cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
cifs_swn.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
cifs_swn.h cifs: simplify SWN code with dummy funcs instead of ifdefs 2021-04-25 16:28:22 -05:00
cifs_unicode.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_unicode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
cifs_uniupr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
cifsacl.c cifs: modefromsids must add an ACE for authenticated users 2022-03-08 19:12:30 +01:00
cifsacl.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifsencrypt.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifsfs.c cifs: fix typo in module parameter enable_gcm_256 2024-07-05 09:14:40 +02:00
cifsfs.h cifs: fix DFS traversal oops without CONFIG_CIFS_DFS_UPCALL 2023-04-05 11:24:59 +02:00
cifsglob.h cifs: Fix UAF in cifs_demultiplex_thread() 2025-05-02 07:44:20 +02:00
cifspdu.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifsproto.h smb: client: fix potential deadlock when releasing mids 2025-05-02 07:44:21 +02:00
cifsroot.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
cifssmb.c cifs: Fix calling CIFSFindFirst() for root path without msearch 2025-08-28 16:24:22 +02:00
connect.c smb: client: Don't log plaintext credentials in cifs_set_cifscreds 2026-04-18 10:33:19 +02:00
dfs_cache.c cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() 2023-02-06 07:59:00 +01:00
dfs_cache.h cifs: support share failover when remounting 2021-07-22 11:43:23 -05:00
dir.c cifs: Fix xid leak in cifs_create() 2022-10-29 10:12:56 +02:00
dns_resolve.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
dns_resolve.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
export.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
file.c smb: client: fix use-after-free in cifs_oplock_break 2025-08-28 16:24:01 +02:00
fs_context.c cifs: fix integer overflow in match_server() 2025-05-02 07:44:27 +02:00
fs_context.h cifs: reinstate original behavior again for forceuid/forcegid 2024-05-02 16:24:43 +02:00
fscache.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
fscache.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
inode.c smb: client: Fix refcount leak for cifs_sb_tlink 2026-04-18 10:33:35 +02:00
ioctl.c smb: client: fix potential UAF in cifs_dump_full_key() 2025-05-02 07:44:20 +02:00
Kconfig cifs: create a MD4 module and switch cifs.ko to use it 2021-08-25 15:48:00 -05:00
link.c cifs: Fix uninitialized memory read for smb311 posix symlink create 2023-01-18 11:48:49 +01:00
Makefile cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
misc.c cifs: Fix cifs_query_path_info() for Windows NT servers 2025-07-10 15:57:31 +02:00
netlink.c cifs: Constify static struct genl_ops 2021-06-20 21:28:16 -05:00
netlink.h cifs: Register generic netlink family 2020-12-14 09:16:22 -06:00
netmisc.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
nterr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
nterr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
ntlmssp.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
readdir.c smb: client: Reset all search buffer pointers when releasing buffer 2025-06-04 14:38:07 +02:00
rfc1002pdu.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
sess.c cifs: Fix xid leak in cifs_ses_add_channel() 2022-10-29 10:12:56 +02:00
smb1ops.c SMB3: drop reference to cfile before sending oplock break 2023-05-24 17:36:54 +01:00
smb2file.c cifs: remove useless parameter 'is_fsctl' from SMB2_ioctl() 2024-03-01 13:21:53 +01:00
smb2glob.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
smb2inode.c cifs: Fix smb2_set_path_size() 2023-03-22 13:31:33 +01:00
smb2maperror.c cifs: cifs_md4 convert to SPDX identifier 2021-08-25 15:51:52 -05:00
smb2misc.c cifs: avoid NULL pointer dereference in dbg call 2025-05-02 07:44:27 +02:00
smb2ops.c smb: client: Fix refcount leak for cifs_sb_tlink 2026-04-18 10:33:35 +02:00
smb2pdu.c smb: client: fix NULL ptr deref in crypto_aead_setkey() 2025-05-02 07:44:21 +02:00
smb2pdu.h smb3: Replace smb2pdu 1-element arrays with flex-arrays 2024-02-23 08:55:15 +01:00
smb2proto.h cifs: remove useless parameter 'is_fsctl' from SMB2_ioctl() 2024-03-01 13:21:53 +01:00
smb2status.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
smb2transport.c smb: client: fix deadlock in smb2_find_smb_tcon() 2024-07-05 09:14:38 +02:00
smbdirect.c smb: client: let recv_done() cleanup before notifying the callers. 2025-08-28 16:24:14 +02:00
smbdirect.h cifs: smbd: Do not schedule work to send immediate packet on every receive 2020-04-07 12:41:16 -05:00
smbencrypt.c cifs: rename cifs_common to smbfs_common 2021-09-08 23:59:26 -05:00
smberr.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
trace.c smb3: Cleanup license mess 2019-01-24 09:37:33 -06:00
trace.h cifs: fix string declarations and assignments in tracepoints 2021-05-27 14:04:32 -05:00
transport.c smb: client: fix potential deadlock when releasing mids 2025-05-02 07:44:21 +02:00
unc.c cifs: don't cargo-cult strndup() 2021-04-25 16:28:23 -05:00
winucase.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
xattr.c smb3: fix caching of ctime on setxattr 2023-12-08 08:48:04 +01:00