From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD2474CA784; Wed, 30 Sep 2026 17:21:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790788867; cv=none; b=GIgAx5LvtCEVO8yNUDnTGjkcR5GHPqrGZZYyhgOzn6RR0CDN5YxXzR3fWarSZFiK4pAXV//QZIhlAccm/gq9B1wtOausXIc1ek1tLXtidRPaCzHRVn9XQBxlKgy2AU4IKnwOcOw0nSoODELVWNi+qF+bz5v1NN2S5MowsNFMOZQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790788867; c=relaxed/simple; bh=UlCxHpEEoemwXNfRCW3PjHCVkKaKLBn3Rj3opUjc6lc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M20mARyoxQTLJLL6fqBG8pfJwrNeP4ySTD0tfdBHTrjeEBzOTT6lTGyXwv+wHL1sUqJNdw6WR+7hZLp5k/j5boolGE9p74R2KJfyFoaMYqBqMl9jTduTZGAa5QpFJthckqi9gw9vJqOeCqaofEnj+ERJfEmlnhfwcG//WWshpvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rilh95Vy; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rilh95Vy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09A561F000FF; Wed, 30 Sep 2026 17:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790788866; bh=MA9QD9dp6GDrVm5+pKizomm65xuC2pvr4/1jsKxfPWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rilh95VyW6Hz8aUxmJ3I1fnU+ocCAjE3MNqxfYK3mcneZdWuIUbcKSW7QW3YyIgos NDH+Ck7DFt0GvaDObbwZvZ1rjSh7UDqT8mEh5S3b6KdTfGg7C/wsbIJztvqteWKqKm by6A86FiV9gYmUF94Z0P+cIf2KW8RNPIA+P9y94U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+5003556314abc915a71f@syzkaller.appspotmail.com, Namjae Jeon , Paulo Alcantara , David Howells , Shyam Prasad N , Ronnie Sahlberg , Tom Talpey , Bharath SM Subject: [PATCH 6.12 276/877] smb: client: cancel reconnect work in clean_demultiplex_info() Date: Wed, 30 Sep 2026 17:19:47 +0200 Message-ID: <20260930152420.675073037@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152414.738996857@linuxfoundation.org> References: <20260930152414.738996857@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paulo Alcantara commit c65eae6f61d1778ff7a82e4aae4080e26f486af1 upstream. 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. Reported-by: syzbot+5003556314abc915a71f@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/6aa4a12d.f81106d8.2ab401.0023.GAE@google.com Fixes: 53e0e11efe92 ("CIFS: Fix a possible memory corruption during reconnect") Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Cc: David Howells Cc: Shyam Prasad N Cc: Ronnie Sahlberg Cc: Tom Talpey Cc: Bharath SM Cc: Namjae Jeon Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/smb/client/connect.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -982,6 +982,7 @@ clean_demultiplex_info(struct TCP_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;