This is a note to let you know that I've just added the patch titled smb3: missing lock when picking channel to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: smb3-missing-lock-when-picking-channel.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 8094a600245e9b28eb36a13036f202ad67c1f887 Mon Sep 17 00:00:00 2001 From: Steve French <stfrench@xxxxxxxxxxxxx> Date: Thu, 25 Apr 2024 11:30:16 -0500 Subject: smb3: missing lock when picking channel From: Steve French <stfrench@xxxxxxxxxxxxx> commit 8094a600245e9b28eb36a13036f202ad67c1f887 upstream. Coverity spotted a place where we should have been holding the channel lock when accessing the ses channel index. Addresses-Coverity: 1582039 ("Data race condition (MISSING_LOCK)") Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Shyam Prasad N <sprasad@xxxxxxxxxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/smb/client/transport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/smb/client/transport.c +++ b/fs/smb/client/transport.c @@ -1057,9 +1057,11 @@ struct TCP_Server_Info *cifs_pick_channe index = (uint)atomic_inc_return(&ses->chan_seq); index %= ses->chan_count; } + + server = ses->chans[index].server; spin_unlock(&ses->chan_lock); - return ses->chans[index].server; + return server; } int Patches currently in stable-queue which might be from stfrench@xxxxxxxxxxxxx are queue-6.6/smb3-fix-lock-ordering-potential-deadlock-in-cifs_sync_mid_result.patch queue-6.6/smb3-missing-lock-when-picking-channel.patch queue-6.6/smb-client-fix-struct_group-usage-in-__packed-structs.patch queue-6.6/cifs-fix-reacquisition-of-volume-cookie-on-still-liv.patch queue-6.6/cifs-reinstate-original-behavior-again-for-forceuid-.patch queue-6.6/smb-client-fix-rename-2-regression-against-samba.patch