]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: client: terminate session upon failed client required signing
authorAaditya Kansal <aadityakansal390@gmail.com>
Thu, 5 Feb 2026 01:00:12 +0000 (06:30 +0530)
committerSteve French <stfrench@microsoft.com>
Mon, 16 Feb 2026 00:35:34 +0000 (18:35 -0600)
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>
fs/smb/client/smb1transport.c

index 93731b00ca5d3922bc168b2a1fbf1a000cadc3d8..38d6d5538b96b5760ca5db08b80a4a89c3a3fa06 100644 (file)
@@ -169,12 +169,18 @@ cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
 
                iov[0].iov_base = mid->resp_buf;
                iov[0].iov_len = len;
-               /* FIXME: add code to kill session */
+
                rc = cifs_verify_signature(&rqst, server,
                                           mid->sequence_number);
-               if (rc)
+               if (rc) {
                        cifs_server_dbg(VFS, "SMB signature verification returned error = %d\n",
                                 rc);
+
+                       if (!(server->sec_mode & SECMODE_SIGN_REQUIRED)) {
+                               cifs_reconnect(server, true);
+                               return rc;
+                       }
+               }
        }
 
        /* BB special case reconnect tid and uid here? */