From patchwork Mon Dec 31 22:13:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Aurich X-Patchwork-Id: 10745575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EB8917E8 for ; Mon, 31 Dec 2018 22:19:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F9D1285AF for ; Mon, 31 Dec 2018 22:19:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FE23285B5; Mon, 31 Dec 2018 22:19:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C59DB285AF for ; Mon, 31 Dec 2018 22:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727945AbeLaWTR (ORCPT ); Mon, 31 Dec 2018 17:19:17 -0500 Received: from o-chul.darkrain42.org ([74.207.241.14]:33142 "EHLO mail.darkrain42.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727416AbeLaWTR (ORCPT ); Mon, 31 Dec 2018 17:19:17 -0500 X-Greylist: delayed 318 seconds by postgrey-1.27 at vger.kernel.org; Mon, 31 Dec 2018 17:19:16 EST Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by o-chul.darkrain42.org (Postfix) with ESMTPSA id D58108164; Mon, 31 Dec 2018 14:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=darkrain42.org; s=a; t=1546294437; bh=HwEJrvXDdqimgU9hx9IuBFwIbjV3ctTOmuYQt/REhfk=; h=From:To:Cc:Subject:Date:From; b=qde5Yy97gjSX54513yn+h5hQwKaC0ycV1dqrsDsDQMaUvUntWZcZpY+VmbTFTgFT4 7zBPsoKvkbOx8IJYRz3tFs2GRuzFJzDk8+pMFTjUPIEVKt+bqLSLiEByh1UF8l2LKZ 1LOl70hlAILq0l2UYNa2jFvd/0YVg3jJa6zRhrNN8YucJxHNivX2NK457zHa9faakk 5vJVn16Cd2Q9rQOD7367fOrIivtUpadZwqbP/GZ9HhsSDvvtyauFHgoZdos1joKjFf RFgx9ZtWn+xyuCwg/8NgJJRzS1brzJWL6Bh5xDnoJEMVc+BKlOaXgwe0gj0nzv5473 1DDpEl1dCqXgw== From: Paul Aurich To: linux-cifs@vger.kernel.org Cc: Paul Aurich Subject: [PATCH] smb3: fix large reads on encrypted connections Date: Mon, 31 Dec 2018 14:13:34 -0800 Message-Id: <20181231221334.25008-1-paul@darkrain42.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 # 4.19+ Fixes: b24df3e30cbf ("cifs: update receive_encrypted_standard to handle compounded responses") Signed-off-by: Paul Aurich --- 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); }