Revert "fix"
authorSteve French <stfrench@microsoft.com>
Wed, 14 Sep 2022 05:47:06 +0000 (00:47 -0500)
committerSteve French <stfrench@microsoft.com>
Wed, 14 Sep 2022 05:47:06 +0000 (00:47 -0500)
This reverts commit 12303508b1ab7f992359af5c7f415a303c0360e5.

fs/cifs/cifs_debug.c
fs/cifs/smb2glob.h
fs/cifs/smb2ops.c
fs/cifs/smb2transport.c

index 86a5fb93f07f2c372c4dfe509451e27cbff7af66..c05477e28cffa698868655e24142aaf0e52f83a6 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/uaccess.h>
 #include "cifspdu.h"
 #include "cifsglob.h"
-#include "smb2glob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
 #include "cifsfs.h"
@@ -355,8 +354,7 @@ skip_rdma:
                else if (server->compress_algorithm == SMB3_COMPRESS_LZ77_HUFF)
                        seq_printf(m, " COMPRESS_LZ77_HUFF");
                if (server->sign)
-                       seq_printf(m, " signed (%s)",
-                                  smb2_signing_algo_str(server->signing_algorithm));
+                       seq_printf(m, " signed");
                if (server->posix_ext_supported)
                        seq_printf(m, " posix");
                if (server->nosharesock)
@@ -407,8 +405,7 @@ skip_rdma:
                        if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
                                seq_puts(m, " encrypted");
                        if (ses->sign)
-                               seq_printf(m, " signed (%s)",
-                                  smb2_signing_algo_str(server->signing_algorithm));
+                               seq_puts(m, " signed");
 
                        seq_printf(m, "\n\tUser: %d Cred User: %d",
                                   from_kuid(&init_user_ns, ses->linux_uid),
index 3a3e81b1b8cb8961b11de0134c863f54e613a337..82e916ad167c00b9fac7c5ea36756302b867287e 100644 (file)
 #define END_OF_CHAIN 4
 #define RELATED_REQUEST 8
 
-static inline const char *smb2_signing_algo_str(u16 algo)
-{
-       switch (algo) {
-       case SIGNING_ALG_HMAC_SHA256: return "HMAC-SHA256";
-       case SIGNING_ALG_AES_CMAC: return "AES-CMAC";
-       case SIGNING_ALG_AES_GMAC: return "AES-GMAC";
-       default: return "unknown algorithm";
-       }
-}
-
 #endif /* _SMB2_GLOB_H */
index f052e192e441e34d96de4060155f75209db6076c..bca88f511f3f86c3625144d380fc9a9cf0a7e673 100644 (file)
@@ -4663,11 +4663,11 @@ static int smb311_aes_gmac_nonce(struct smb2_hdr *shdr, bool is_server,
 
        /* request is coming from the server, set LSB */
        if (is_server)
-               nonce.role |= cpu_to_le32(1);
+               nonce.role |= 1UL << 0;
 
        /* set penultimate LSB if SMB2_CANCEL command */
        if (shdr->Command == SMB2_CANCEL)
-               nonce.role |= cpu_to_le32(1UL << 1);
+               nonce.role |= 1UL << 1;
 
        memcpy(*out_nonce, (u8 *)&nonce, SMB3_AES_GCM_NONCE);
 
index 84cc560f5484c16adc247c3cc321b49d2042f29e..36de63f57f4eada5eede0f35d34dba3016204d27 100644 (file)
@@ -663,7 +663,7 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
        if ((shdr->Command == SMB2_NEGOTIATE) ||
            (shdr->Command == SMB2_SESSION_SETUP) ||
            (shdr->Command == SMB2_OPLOCK_BREAK) ||
-           (shdr->MessageId == U64_MAX) || /* MS-SMB2 3.2.5.1.3 */
+           (shdr->MessageId == 0xFFFFFFFFFFFFFFFF) || /* MS-SMB2 3.2.5.1.3 */
            (shdr->Status == STATUS_PENDING) || /* MS-SMB2 3.2.5.1.3 */
            server->ignore_signature ||
            (!server->session_estab))