]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cifs: silence printk when establishing first session on socket
authorJeff Layton <jlayton@redhat.com>
Mon, 6 Jun 2011 19:40:23 +0000 (15:40 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:05:35 +0000 (15:05 -0700)
commit 9c4843ea576107a3c1fb94f2f758f198e9fe9e54 upstream.

When signing is enabled, the first session that's established on a
socket will cause a printk like this to pop:

    CIFS VFS: Unexpected SMB signature

This is because the key exchange hasn't happened yet, so the signature
field is bogus. Don't try to check the signature on the socket until the
first session has been established. Also, eliminate the specific check
for SMB_COM_NEGOTIATE since this check covers that case too.

Cc: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifsencrypt.c

index d1a016be73ba75c7a70cb099cd5fdb55150926a9..ba3d95bf6e08d5c6870ab90d98188604be01cd6f 100644 (file)
@@ -184,7 +184,7 @@ int cifs_verify_signature(struct smb_hdr *cifs_pdu,
        if (cifs_pdu == NULL || server == NULL)
                return -EINVAL;
 
-       if (cifs_pdu->Command == SMB_COM_NEGOTIATE)
+       if (!server->session_estab)
                return 0;
 
        if (cifs_pdu->Command == SMB_COM_LOCKING_ANDX) {