FAILED: patch "[PATCH] smb: client: cancel reconnect work in" 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 c65eae6f61d1778ff7a82e4aae4080e26f486af1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026092201-lethargic-bouncing-9f5e@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From c65eae6f61d1778ff7a82e4aae4080e26f486af1 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <[email protected]>
Date: Fri, 11 Sep 2026 22:38:04 -0300
Subject: [PATCH] smb: client: cancel reconnect work in
clean_demultiplex_info()
clean_demultiplex_info() cancels server->echo delayed work but not server->reconnect, which can cause a use-after-free when the demultiplex thread exits while a reconnect work is still queued:
cifs_demultiplex_thread()
cifs_readv_from_socket()
cifs_reconnect()
__cifs_reconnect()
cifs_queue_server_reconn()
mod_delayed_work(cifsiod_wq, &server->reconnect, 0)
clean_demultiplex_info()
cancel_delayed_work_sync(&server->echo) // echo canceled
// reconnect NOT canceled
kfree_sensitive(server) // server freed ...later, on cifsiod_wq:
smb2_reconnect_server()
server->srv_count // UAF read of freed server
Fix this by canceling server->reconnect delayed work in clean_demultiplex_info() before the server is freed, the same way cifs_put_tcp_session() already does.
fs/smb/client/connect.c +1 -0
@@ -1067,6 +1067,7 @@ clean_demultiplex_info(struct TCP_Server_Info *server)spin_unlock (&server->srv_lock);cancel_delayed_work_sync (&server->echo); +cancel_delayed_work_sync (&server->reconnect);spin_lock (&server->srv_lock); server->tcpStatus = CifsExiting;
Sasha Levin
maintainerPATCH 1/1 smb: client: cancel reconnect work in clean_demultiplex_info()
From: Paulo Alcantara <[email protected]>
[ Upstream commit c65eae6f61d1778ff7a82e4aae4080e26f486af1 ]
clean_demultiplex_info() cancels server->echo delayed work but not server->reconnect, which can cause a use-after-free when the demultiplex thread exits while a reconnect work is still queued:
cifs_demultiplex_thread()
cifs_readv_from_socket()
cifs_reconnect()
__cifs_reconnect()
cifs_queue_server_reconn()
mod_delayed_work(cifsiod_wq, &server->reconnect, 0)
clean_demultiplex_info()
cancel_delayed_work_sync(&server->echo) // echo canceled
// reconnect NOT canceled
kfree_sensitive(server) // server freed ...later, on cifsiod_wq:
smb2_reconnect_server()
server->srv_count // UAF read of freed server
Fix this by canceling server->reconnect delayed work in clean_demultiplex_info() before the server is freed, the same way cifs_put_tcp_session() already does.
--- fs/cifs/connect.c | 1 + 1 file changed, 1 insertion(+)
fs/cifs/connect.c +1 -0
@@ -890,6 +890,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)spin_unlock (&cifs_tcp_ses_lock);cancel_delayed_work_sync (&server->echo); +cancel_delayed_work_sync (&server->reconnect);spin_lock (&GlobalMid_Lock); server->tcpStatus = CifsExiting;
Signature · 1 line
2.53.0