lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Nov 2022 13:53:31 +0100
From:   Stefan Metzmacher <metze@...ba.org>
To:     David Howells <dhowells@...hat.com>
Cc:     smfrench@...il.com, tom@...pey.com, Long Li <longli@...rosoft.com>,
        Namjae Jeon <linkinjeon@...nel.org>,
        linux-cifs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cifs: Fix problem with encrypted RDMA data read

Am 16.11.22 um 13:14 schrieb David Howells:
> Stefan Metzmacher <metze@...ba.org> wrote:
> 
>>> Stefan Metzmacher <metze@...ba.org> wrote:
>>>
>>>> I'm not sure I understand why this would fix anything when encryption is
>>>> enabled.
>>>>
>>>> Is the payload still be offloaded as plaintext? Otherwise we wouldn't have
>>>> use_rdma_mr...  So this rather looks like a fix for the non encrypted case.
>>> The "inline"[*] PDUs are encrypted, but the direct RDMA data transmission is
>>> not.  I'm not sure if this is a bug in ksmbd.
>>
>> It's a bug in the client!
> 
> Well, if you can fix it the right way, I can test the patch.  I'm not sure
> what that would be if not what I suggested.

As written in the other mail something like this:

  fs/cifs/smb2pdu.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index a5695748a89b..d478b0a89890 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -4090,7 +4090,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
  	 * If we want to do a RDMA write, fill in and append
  	 * smbd_buffer_descriptor_v1 to the end of read request
  	 */
-	if (server->rdma && rdata && !server->sign &&
+	if (server->rdma && rdata && !server->sign && !smb3_encryption_required(io_parms->tcon) &&
  		rdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) {

  		struct smbd_buffer_descriptor_v1 *v1;
@@ -4517,8 +4517,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
  	 * If we want to do a server RDMA read, fill in and append
  	 * smbd_buffer_descriptor_v1 to the end of write request
  	 */
-	if (server->rdma && !server->sign && wdata->bytes >=
-		server->smbd_conn->rdma_readwrite_threshold) {
+	if (server->rdma && !server->sign && !smb3_encryption_required(tcon) &&
+		wdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) {

  		struct smbd_buffer_descriptor_v1 *v1;
  		bool need_invalidate = server->dialect == SMB30_PROT_ID;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ