Skip to content

Commit dc96f01

Browse files
Nightfire390smfrench
authored andcommitted
smb: client: terminate session upon failed client required signing
Currently, when smb signature verification fails, the behaviour is to log the failure without any action to terminate the session. Call cifs_reconnect() when client required signature verification fails. Otherwise, log the error without reconnecting. Signed-off-by: Aaditya Kansal <aadityakansal390@gmail.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 14f66f4 commit dc96f01

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

fs/smb/client/smb1transport.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,18 @@ cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
169169

170170
iov[0].iov_base = mid->resp_buf;
171171
iov[0].iov_len = len;
172-
/* FIXME: add code to kill session */
172+
173173
rc = cifs_verify_signature(&rqst, server,
174174
mid->sequence_number);
175-
if (rc)
175+
if (rc) {
176176
cifs_server_dbg(VFS, "SMB signature verification returned error = %d\n",
177177
rc);
178+
179+
if (!(server->sec_mode & SECMODE_SIGN_REQUIRED)) {
180+
cifs_reconnect(server, true);
181+
return rc;
182+
}
183+
}
178184
}
179185

180186
/* BB special case reconnect tid and uid here? */

0 commit comments

Comments
 (0)