FAILED: patch "[PATCH] smb: client: fix smbd_connection leak on" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x e75c96157d45e498970158c8f7373d90102e33b9
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026092222-drool-acetone-c3a8@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e75c96157d45e498970158c8f7373d90102e33b9 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <[email protected]>
Date: Sat, 12 Sep 2026 14:20:08 -0300
Subject: [PATCH] smb: client: fix smbd_connection leak on
cifs_get_tcp_session() error
When an RDMA connection is successfully established via smbd_get_connection() but cifs_get_tcp_session() later fails (e.g. kthread_create() returns an error), the error path frees tcp_ses without first destroying the smbd_connection.
Fix this by calling smbd_destroy() in the out_err cleanup path before kfree(tcp_ses). smbd_destroy() safely handles the case where smbd_conn is NULL, so it can be called unconditionally.
fs/smb/client/connect.c +1 -0
@@ -1934,6 +1934,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,kfree (tcp_ses->leaf_fullpath);if (tcp_ses->ssocket)sock_release (tcp_ses->ssocket); +smbd_destroy (tcp_ses);kfree (tcp_ses); }return ERR_PTR (rc);
Sasha Levin
maintainerPATCH 1/1 smb: client: fix smbd_connection leak on cifs_get_tcp_session() error
From: Paulo Alcantara <[email protected]>
[ Upstream commit e75c96157d45e498970158c8f7373d90102e33b9 ]
When an RDMA connection is successfully established via smbd_get_connection() but cifs_get_tcp_session() later fails (e.g. kthread_create() returns an error), the error path frees tcp_ses without first destroying the smbd_connection.
Fix this by calling smbd_destroy() in the out_err cleanup path before kfree(tcp_ses). smbd_destroy() safely handles the case where smbd_conn is NULL, so it can be called unconditionally.
--- fs/cifs/connect.c | 1 + 1 file changed, 1 insertion(+)
fs/cifs/connect.c +1 -0
@@ -2676,6 +2676,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)kfree (tcp_ses->hostname);if (tcp_ses->ssocket)sock_release (tcp_ses->ssocket); +smbd_destroy (tcp_ses);kfree (tcp_ses); }return ERR_PTR (rc);
Signature · 1 line
2.53.0