linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] cifs: remove rfc1002 length field from all SMB2 response structures
@ 2018-01-21 22:06 Ronnie Sahlberg
       [not found] ` <20180121220644.7907-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ronnie Sahlberg @ 2018-01-21 22:06 UTC (permalink / raw)
  To: linux-cifs; +Cc: Steve French

Steve, All

Review but do not merge to for-next. This patch still breaks SMBD.
I have tested the patch with SMB1/2/3 with and without signing as well as
with SMB3 encryption and it works in my tests.

The first patch removes the rfc1002 length from all the response structures
hopefully making it easier to implement compounding later. It also gets rid
of a lot of magic add/subtract 4 from various computations.

The second patch updates the demultiplex loop so that it will now be able
to handle compounded responses we receive from the server. In theory, we
will not know it this works until we can actually send compounded requests.



Next steps will be to start implementing the actual compounding.
That, I think, will consist of refactoring the SMB2_open/query/close
functions into dedicated marshalling functions and then create a new
compound_send_recv() function.
The second part will require some additional plumbing.
In smb2_send_recv() we currently create iovectors as
[0] length
[1] smb2 header
[2+] additional data

or, when smb3 encryption is used

[0] length
[1] transform header
[2] smb2 header
[3+] additional data

Instead, in compound_send_recv() we will need to create an array of iovectors,
one for each pdu, that would look like
[0] smb2 header
[1+] additional data

and similar for smb3 encryption.

These iovectors would then be propagated down the stack without an initial
length field until we are ready to transmit them.
So, for the TCP case, we would not prepend the vectors we want to send with
a [0] length field until the point where we are just about to start writing
the data to the tcp socket.

That shouldnt be too hard. But we need these patches first.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-26 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-21 22:06 [PATCH 0/2] cifs: remove rfc1002 length field from all SMB2 response structures Ronnie Sahlberg
     [not found] ` <20180121220644.7907-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-21 22:06   ` [PATCH 1/2] cifs: remove rfc1002 header " Ronnie Sahlberg
2018-01-21 22:06   ` [PATCH 2/2] cifs: update multiplex loop to handle compounded responses Ronnie Sahlberg
2018-01-26 16:57   ` [PATCH 0/2] cifs: remove rfc1002 length field from all SMB2 response structures Aurélien Aptel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).