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 E5BD13E40E9; Wed, 30 Sep 2026 19:28:16 +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=1790796498; cv=none; b=LjxRCRIerheSdmbDxudjXlHp9d5M5tOOm2t/mFoLFfKUvcBrD1eMyNJIvLUMqkARS1QwI8g0DTGJwqwnfS79oCjBND79LVDrIHjL67ZbyODtJOHXT9IiEz3YHfa0tIUa25UCMeH9blk+gGMZr68i7PIghWWrpQTJ/Q66cg/m3+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790796498; c=relaxed/simple; bh=8k6iNAF/cypXooafd7MeaPuQIaCW66bic2bwM88fUnM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gq00u3eGtEGSdu81TUhQ/phEc71jQ/s8IYZinpXdIIgVEK4trm6b1UfimvdjijC9hAu8MyX0/rQhrJnzR89NeNY/0R5HSkMw80t/EUGdmV0BgToMd5l317Jc0XwWE2/mUAnTczOC6O4C7spgrvo06sI/eWKbnWMm5UbR6E+vE+Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pVNiUIYX; 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="pVNiUIYX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1495D1F000FF; Wed, 30 Sep 2026 19:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790796496; bh=ApW6tH2fFt+qWc/bt0U0NNNGikl0aMD9D13D7PVwaUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pVNiUIYX/POlB6IEbmPd1E091ulCO2IEKBxc2u6/g+2br9hQY2XI4rehzp8GIiqZG GDkJPZPYO5u8v8iLQR2yjdzeGmkgKmLjOxr+uOyxvWGIU1QBAo9RsfI2Hc1ar2HaT3 d0c5cCcvo8zSMkGLNF8gS+R9AZ5jf0ryQvB7MCWg= 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.6 0933/1193] smb: client: cancel reconnect work in clean_demultiplex_info() Date: Wed, 30 Sep 2026 17:26:57 +0200 Message-ID: <20260930152454.971673728@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@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.6-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 @@ -998,6 +998,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;