diff mbox

cifs: silence printk when establishing first session on socket

Message ID 1307389223-25744-1-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton June 6, 2011, 7:40 p.m. UTC
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: stable@kernel.org
Cc: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/cifsencrypt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Shirish Pargaonkar June 7, 2011, 2:10 a.m. UTC | #1
On Mon, Jun 6, 2011 at 2:40 PM, Jeff Layton <jlayton@redhat.com> wrote:
> 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: stable@kernel.org
> Cc: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/cifs/cifsencrypt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
> index dfbd9f1..5a0ee7f 100644
> --- a/fs/cifs/cifsencrypt.c
> +++ b/fs/cifs/cifsencrypt.c
> @@ -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) {
> --
> 1.7.5.2
>
>

No more that message in syslog buffer...

Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index dfbd9f1..5a0ee7f 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -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) {