diff mbox series

[2/3] cifs: fix computation for MAX_SMB2_HDR_SIZE

Message ID 20190125010219.4561-3-lsahlber@redhat.com (mailing list archive)
State New, archived
Headers show
Series patches for querying attributes | expand

Commit Message

Ronnie Sahlberg Jan. 25, 2019, 1:02 a.m. UTC
The size of the fixed part of the create response is 88 bytes not 56.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/smb2pdu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Pavel Shilovsky Jan. 26, 2019, 2:10 a.m. UTC | #1
чт, 24 янв. 2019 г. в 17:03, Ronnie Sahlberg <lsahlber@redhat.com>:
>
> The size of the fixed part of the create response is 88 bytes not 56.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/smb2pdu.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
> index 05dea6750c33..d8944846e6ae 100644
> --- a/fs/cifs/smb2pdu.h
> +++ b/fs/cifs/smb2pdu.h
> @@ -84,8 +84,8 @@
>
>  #define NUMBER_OF_SMB2_COMMANDS        0x0013
>
> -/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
> -#define MAX_SMB2_HDR_SIZE 0x00b0
> +/* 4 len + 52 transform hdr + 64 hdr + 88 create rsp */
> +#define MAX_SMB2_HDR_SIZE 208

Should we still account for RFC length of 4 bytes in the header?

--
Best regards,
Pavel Shilovsky
ronnie sahlberg Jan. 26, 2019, 2:21 a.m. UTC | #2
On Sat, Jan 26, 2019 at 12:11 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
>
> чт, 24 янв. 2019 г. в 17:03, Ronnie Sahlberg <lsahlber@redhat.com>:
> >
> > The size of the fixed part of the create response is 88 bytes not 56.
> >
> > Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> > ---
> >  fs/cifs/smb2pdu.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
> > index 05dea6750c33..d8944846e6ae 100644
> > --- a/fs/cifs/smb2pdu.h
> > +++ b/fs/cifs/smb2pdu.h
> > @@ -84,8 +84,8 @@
> >
> >  #define NUMBER_OF_SMB2_COMMANDS        0x0013
> >
> > -/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
> > -#define MAX_SMB2_HDR_SIZE 0x00b0
> > +/* 4 len + 52 transform hdr + 64 hdr + 88 create rsp */
> > +#define MAX_SMB2_HDR_SIZE 208
>
> Should we still account for RFC length of 4 bytes in the header?

Good point. No we shouldn't.

Thinking about it, in the other patch where I set the maximum create
response size to
822 bytes (64 bytes header + 88 bytes create response + 520 bytes name
+ 150 bytes context)
Should actually be 824   since we need to take into account that there
would possibly be two extra bytes of padding for a compounded create.

I can send a follow up patch to fix both these.

>
> --
> Best regards,
> Pavel Shilovsky
Pavel Shilovsky Jan. 29, 2019, 2:23 a.m. UTC | #3
Don't you think the original version of the patch should be marked for stable?
--
Best regards,
Pavel Shilovsky

пт, 25 янв. 2019 г. в 18:21, ronnie sahlberg <ronniesahlberg@gmail.com>:
>
> On Sat, Jan 26, 2019 at 12:11 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
> >
> > чт, 24 янв. 2019 г. в 17:03, Ronnie Sahlberg <lsahlber@redhat.com>:
> > >
> > > The size of the fixed part of the create response is 88 bytes not 56.
> > >
> > > Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> > > ---
> > >  fs/cifs/smb2pdu.h | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
> > > index 05dea6750c33..d8944846e6ae 100644
> > > --- a/fs/cifs/smb2pdu.h
> > > +++ b/fs/cifs/smb2pdu.h
> > > @@ -84,8 +84,8 @@
> > >
> > >  #define NUMBER_OF_SMB2_COMMANDS        0x0013
> > >
> > > -/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
> > > -#define MAX_SMB2_HDR_SIZE 0x00b0
> > > +/* 4 len + 52 transform hdr + 64 hdr + 88 create rsp */
> > > +#define MAX_SMB2_HDR_SIZE 208
> >
> > Should we still account for RFC length of 4 bytes in the header?
>
> Good point. No we shouldn't.
>
> Thinking about it, in the other patch where I set the maximum create
> response size to
> 822 bytes (64 bytes header + 88 bytes create response + 520 bytes name
> + 150 bytes context)
> Should actually be 824   since we need to take into account that there
> would possibly be two extra bytes of padding for a compounded create.
>
> I can send a follow up patch to fix both these.
>
> >
> > --
> > Best regards,
> > Pavel Shilovsky
ronnie sahlberg Jan. 29, 2019, 2:58 a.m. UTC | #4
I just resent it and the other patch.

I have dropped the initial 4 bytes from the constant.
Yeah, it maybe should go to stable.


On Tue, Jan 29, 2019 at 12:24 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
>
> Don't you think the original version of the patch should be marked for stable?
> --
> Best regards,
> Pavel Shilovsky
>
> пт, 25 янв. 2019 г. в 18:21, ronnie sahlberg <ronniesahlberg@gmail.com>:
> >
> > On Sat, Jan 26, 2019 at 12:11 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
> > >
> > > чт, 24 янв. 2019 г. в 17:03, Ronnie Sahlberg <lsahlber@redhat.com>:
> > > >
> > > > The size of the fixed part of the create response is 88 bytes not 56.
> > > >
> > > > Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> > > > ---
> > > >  fs/cifs/smb2pdu.h | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
> > > > index 05dea6750c33..d8944846e6ae 100644
> > > > --- a/fs/cifs/smb2pdu.h
> > > > +++ b/fs/cifs/smb2pdu.h
> > > > @@ -84,8 +84,8 @@
> > > >
> > > >  #define NUMBER_OF_SMB2_COMMANDS        0x0013
> > > >
> > > > -/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
> > > > -#define MAX_SMB2_HDR_SIZE 0x00b0
> > > > +/* 4 len + 52 transform hdr + 64 hdr + 88 create rsp */
> > > > +#define MAX_SMB2_HDR_SIZE 208
> > >
> > > Should we still account for RFC length of 4 bytes in the header?
> >
> > Good point. No we shouldn't.
> >
> > Thinking about it, in the other patch where I set the maximum create
> > response size to
> > 822 bytes (64 bytes header + 88 bytes create response + 520 bytes name
> > + 150 bytes context)
> > Should actually be 824   since we need to take into account that there
> > would possibly be two extra bytes of padding for a compounded create.
> >
> > I can send a follow up patch to fix both these.
> >
> > >
> > > --
> > > Best regards,
> > > Pavel Shilovsky
diff mbox series

Patch

diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 05dea6750c33..d8944846e6ae 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -84,8 +84,8 @@ 
 
 #define NUMBER_OF_SMB2_COMMANDS	0x0013
 
-/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
-#define MAX_SMB2_HDR_SIZE 0x00b0
+/* 4 len + 52 transform hdr + 64 hdr + 88 create rsp */
+#define MAX_SMB2_HDR_SIZE 208
 
 #define SMB2_PROTO_NUMBER cpu_to_le32(0x424d53fe)
 #define SMB2_TRANSFORM_PROTO_NUM cpu_to_le32(0x424d53fd)