Skip to content

Commit cc95b67

Browse files
aaptelsmfrench
authored andcommitted
cifs: fix channel signing
The server var was accidentally used as an iterator over the global list of connections, thus overwritten the passed argument. This resulted in the wrong signing key being returned for extra channels. Fix this by using a separate var to iterate. Signed-off-by: Aurelien Aptel <[email protected]> Signed-off-by: Steve French <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Reviewed-by: Pavel Shilovsky <[email protected]>
1 parent d26c2dd commit cc95b67

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/cifs/smb2transport.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,14 @@ int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key)
104104
{
105105
struct cifs_chan *chan;
106106
struct cifs_ses *ses = NULL;
107+
struct TCP_Server_Info *it = NULL;
107108
int i;
108109
int rc = 0;
109110

110111
spin_lock(&cifs_tcp_ses_lock);
111112

112-
list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
113-
list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
113+
list_for_each_entry(it, &cifs_tcp_ses_list, tcp_ses_list) {
114+
list_for_each_entry(ses, &it->smb_ses_list, smb_ses_list) {
114115
if (ses->Suid == ses_id)
115116
goto found;
116117
}

0 commit comments

Comments
 (0)