diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 7e73176acb58..c5807d39dced 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -175,6 +175,9 @@ cifs_reconnect(struct TCP_Server_Info *server) | |||
175 | } | 175 | } |
176 | server->sequence_number = 0; | 176 | server->sequence_number = 0; |
177 | server->session_estab = false; | 177 | server->session_estab = false; |
178 | kfree(server->session_key.response); | ||
179 | server->session_key.response = NULL; | ||
180 | server->session_key.len = 0; | ||
178 | 181 | ||
179 | spin_lock(&GlobalMid_Lock); | 182 | spin_lock(&GlobalMid_Lock); |
180 | list_for_each(tmp, &server->pending_mid_q) { | 183 | list_for_each(tmp, &server->pending_mid_q) { |
@@ -1562,6 +1565,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server) | |||
1562 | 1565 | ||
1563 | cifs_fscache_release_client_cookie(server); | 1566 | cifs_fscache_release_client_cookie(server); |
1564 | 1567 | ||
1568 | kfree(server->session_key.response); | ||
1569 | server->session_key.response = NULL; | ||
1570 | server->session_key.len = 0; | ||
1571 | |||
1565 | task = xchg(&server->tsk, NULL); | 1572 | task = xchg(&server->tsk, NULL); |
1566 | if (task) | 1573 | if (task) |
1567 | force_sig(SIGKILL, task); | 1574 | force_sig(SIGKILL, task); |
@@ -3178,10 +3185,11 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *ses, | |||
3178 | } else { | 3185 | } else { |
3179 | mutex_lock(&ses->server->srv_mutex); | 3186 | mutex_lock(&ses->server->srv_mutex); |
3180 | if (!server->session_estab) { | 3187 | if (!server->session_estab) { |
3181 | memcpy(&server->session_key.data, | 3188 | server->session_key.response = ses->auth_key.response; |
3182 | &ses->auth_key.data, ses->auth_key.len); | ||
3183 | server->session_key.len = ses->auth_key.len; | 3189 | server->session_key.len = ses->auth_key.len; |
3184 | ses->server->session_estab = true; | 3190 | server->sequence_number = 0x2; |
3191 | server->session_estab = true; | ||
3192 | ses->auth_key.response = NULL; | ||
3185 | } | 3193 | } |
3186 | mutex_unlock(&server->srv_mutex); | 3194 | mutex_unlock(&server->srv_mutex); |
3187 | 3195 | ||
@@ -3192,6 +3200,10 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *ses, | |||
3192 | spin_unlock(&GlobalMid_Lock); | 3200 | spin_unlock(&GlobalMid_Lock); |
3193 | } | 3201 | } |
3194 | 3202 | ||
3203 | kfree(ses->auth_key.response); | ||
3204 | ses->auth_key.response = NULL; | ||
3205 | ses->auth_key.len = 0; | ||
3206 | |||
3195 | return rc; | 3207 | return rc; |
3196 | } | 3208 | } |
3197 | 3209 | ||