From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org, smfrench@gmail.com,
senozhatsky@chromium.org, tom@talpey.com,
atteh.mailbox@gmail.com, Steve French <stfrench@microsoft.com>
Subject: Re: [PATCH] ksmbd: return unsupported error on smb1 mount
Date: Thu, 23 Mar 2023 11:53:19 +0900 [thread overview]
Message-ID: <20230323025319.GA3271889@google.com> (raw)
In-Reply-To: <20230321133312.103789-3-linkinjeon@kernel.org>
On (23/03/21 22:33), Namjae Jeon wrote:
[..]
> @@ -442,9 +442,26 @@ static int smb_handle_negotiate(struct ksmbd_work *work)
> {
> struct smb_negotiate_rsp *neg_rsp = work->response_buf;
>
> - ksmbd_debug(SMB, "Unsupported SMB protocol\n");
> - neg_rsp->hdr.Status.CifsError = STATUS_INVALID_LOGON_TYPE;
> - return -EINVAL;
> + ksmbd_debug(SMB, "Unsupported SMB1 protocol\n");
> +
> + /*
> + * Remove 4 byte direct TCP header, add 1 byte wc, 2 byte bcc
> + * and 2 byte DialectIndex.
> + */
> + *(__be32 *)work->response_buf =
> + cpu_to_be32(sizeof(struct smb_hdr) - 4 + 2 + 2);
In other words cpu_to_be32(sizeof(struct smb_hdr)).
> + neg_rsp->hdr.Status.CifsError = STATUS_SUCCESS;
> +
> + neg_rsp->hdr.Command = SMB_COM_NEGOTIATE;
> + *(__le32 *)neg_rsp->hdr.Protocol = SMB1_PROTO_NUMBER;
I assume this should say cpu_to_le32(SMB1_PROTO_NUMBER).
next prev parent reply other threads:[~2023-03-23 2:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 13:33 [PATCH] ksmbd: don't terminate inactive sessions after a few seconds Namjae Jeon
2023-03-21 13:33 ` [PATCH] ksmbd: return STATUS_NOT_SUPPORTED on unsupported smb2.0 dialect Namjae Jeon
2023-03-21 13:33 ` [PATCH] ksmbd: return unsupported error on smb1 mount Namjae Jeon
2023-03-23 2:53 ` Sergey Senozhatsky [this message]
2023-03-23 4:10 ` Namjae Jeon
2023-03-23 5:00 ` Sergey Senozhatsky
2023-03-23 5:04 ` Namjae Jeon
2023-03-23 5:17 ` [PATCH v2] " Namjae Jeon
2023-03-24 3:44 ` Sergey Senozhatsky
2023-03-24 3:50 ` [PATCH] ksmbd: don't terminate inactive sessions after a few seconds Sergey Senozhatsky
2023-03-24 4:28 ` Namjae Jeon
2023-03-24 5:45 ` Sergey Senozhatsky
2023-03-24 7:00 ` Namjae Jeon
2023-03-24 5:43 ` Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230323025319.GA3271889@google.com \
--to=senozhatsky@chromium.org \
--cc=atteh.mailbox@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=smfrench@gmail.com \
--cc=stfrench@microsoft.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox