diff mbox series

smb3: fix large reads on encrypted connections

Message ID 20181231221334.25008-1-paul@darkrain42.org (mailing list archive)
State New, archived
Headers show
Series smb3: fix large reads on encrypted connections | expand

Commit Message

Paul Aurich Dec. 31, 2018, 10:13 p.m. UTC
When passing a large read to receive_encrypted_read(), ensure that the
demultiplex_thread knows that a MID was processed.  Without this, those
operations never complete.

This is a similar issue/fix to lease break handling:
commit 7af929d6d05ba5564139718e30d5bc96bdbc716a
("smb3: fix lease break problem introduced by compounding")

CC: Stable <stable@vger.kernel.org> # 4.19+
Fixes: b24df3e30cbf ("cifs: update receive_encrypted_standard to handle compounded responses")
Signed-off-by: Paul Aurich <paul@darkrain42.org>
---
 fs/cifs/smb2ops.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Steve French Jan. 1, 2019, 10:58 p.m. UTC | #1
Tentatively merged into cifs-2.6.git for-next pending more testing/reviews

On Mon, Dec 31, 2018 at 4:59 PM Paul Aurich <paul@darkrain42.org> wrote:
>
> When passing a large read to receive_encrypted_read(), ensure that the
> demultiplex_thread knows that a MID was processed.  Without this, those
> operations never complete.
>
> This is a similar issue/fix to lease break handling:
> commit 7af929d6d05ba5564139718e30d5bc96bdbc716a
> ("smb3: fix lease break problem introduced by compounding")
>
> CC: Stable <stable@vger.kernel.org> # 4.19+
> Fixes: b24df3e30cbf ("cifs: update receive_encrypted_standard to handle compounded responses")
> Signed-off-by: Paul Aurich <paul@darkrain42.org>
> ---
>  fs/cifs/smb2ops.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index 33100ef74d7f..cf7eb891804f 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -3472,8 +3472,10 @@ smb3_receive_transform(struct TCP_Server_Info *server,
>         }
>
>         /* TODO: add support for compounds containing READ. */
> -       if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server))
> +       if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server)) {
> +               *num_mids = 1;
>                 return receive_encrypted_read(server, &mids[0]);
> +       }
>
>         return receive_encrypted_standard(server, mids, bufs, num_mids);
>  }
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 33100ef74d7f..cf7eb891804f 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -3472,8 +3472,10 @@  smb3_receive_transform(struct TCP_Server_Info *server,
 	}
 
 	/* TODO: add support for compounds containing READ. */
-	if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server))
+	if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server)) {
+		*num_mids = 1;
 		return receive_encrypted_read(server, &mids[0]);
+	}
 
 	return receive_encrypted_standard(server, mids, bufs, num_mids);
 }