]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: generate signkey for the channel that's reconnecting
authorShyam Prasad N <sprasad@microsoft.com>
Fri, 10 Mar 2023 15:32:01 +0000 (15:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:58 +0000 (13:33 +0100)
commit 405e9d28776f4f3e32969d6eb9746c4596907bc1 upstream.

Before my changes to how multichannel reconnects work, the
primary channel was always used to do a non-binding session
setup. With my changes, that is not the case anymore.
Missed this place where channel at index 0 was forcibly
updated with the signing key.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2transport.c

index 381babc1212c9e8a95911e6382e5ba4ff5c3cc80..d827b7547ffadaeb97e6609b821dbd9e63f159dc 100644 (file)
@@ -425,7 +425,7 @@ generate_smb3signingkey(struct cifs_ses *ses,
 
                /* safe to access primary channel, since it will never go away */
                spin_lock(&ses->chan_lock);
-               memcpy(ses->chans[0].signkey, ses->smb3signingkey,
+               memcpy(ses->chans[chan_index].signkey, ses->smb3signingkey,
                       SMB3_SIGN_KEY_SIZE);
                spin_unlock(&ses->chan_lock);