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 0763232BF5D; Thu, 28 May 2026 19:53:21 +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=1779998003; cv=none; b=b7m/DCtawuf5KauZX3aBWmMexnS+oZl1adifCCEmaYLLwUO22gEkJgEUB6o27xotTouOg8tFA0JK2u1ksAFMwmph4Pvqb0s5+J6wRvxgVuqhinyrUkHbnV0gAR8hazqL/eqIkIj0YOSrWc89aySjuLaCogzI+A+P+wz9ZNVR1ts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998003; c=relaxed/simple; bh=/H8qXWBeENcX4NgnB7RWprirZBNqfT8rcycYnFkRhRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lys9b6s99InUspi6wP3abWen3stW2pN3+cj+I0ithBy7HuAEGmPS7pThcotE2s/y+tKGuIcKMgCKiT1Asz/jhjig0V/0AF0GGayAWcp3+/g3GWq/XzVrt2U8FpfZ0Po27I+fuelTONu5ARoAOyXSGTMUwlHbdyRxh8W8nNBZ6/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rkAwDUSa; 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="rkAwDUSa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25F3E1F000E9; Thu, 28 May 2026 19:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779998001; bh=6k8WsUTwv0OBff59aJ3weRTzznd4NQ1JwIfvmYm+LjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rkAwDUSaGYBpBTIMEgYCRD/2jFC2+h2h2qUgwafOjNU9PUUSZTpUjc+g/4Lkmtx9t 1z9bNN4wyPNmF4O5/qyS72RdqkeffcozSdTOoeASgwOd1lgMgZqQZlc4VuoEblRH0v suJM/LsUVH7w9Oqb9h0M6dJAQM3cbIInjYyMiSfU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shyam Prasad N , Henrique Carvalho , Steve French Subject: [PATCH 7.0 019/461] smb: client: protect tc_count increment in smb2_find_smb_sess_tcon_unlocked() Date: Thu, 28 May 2026 21:42:28 +0200 Message-ID: <20260528194647.431882922@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194646.819809818@linuxfoundation.org> References: <20260528194646.819809818@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 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Henrique Carvalho commit 4d8690dace005a38e6dbde9ecce2da3ad85c7c41 upstream. Commit 96c4af418586 ("cifs: Fix locking usage for tcon fields") refactored cifs code to change cifs_tcp_ses_lock for tc_lock around tc_count changes. There was missing lock around tc_count increment inside smb2_find_smb_sess_tcon_unlocked(). Cc: stable@vger.kernel.org Fixes: 96c4af418586 ("cifs: Fix locking usage for tcon fields") Reviewed-by: Shyam Prasad N Signed-off-by: Henrique Carvalho Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/smb/client/smb2transport.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/smb/client/smb2transport.c +++ b/fs/smb/client/smb2transport.c @@ -176,7 +176,9 @@ smb2_find_smb_sess_tcon_unlocked(struct list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { if (tcon->tid != tid) continue; + spin_lock(&tcon->tc_lock); ++tcon->tc_count; + spin_unlock(&tcon->tc_lock); trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, netfs_trace_tcon_ref_get_find_sess_tcon); return tcon;