Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:32 +0100
commit7ed3431f250bf6145a4c2fa2ff8b9ad7a867a524 (patch)
tree158156647afeb9dc912ebb29faeb48a3ad97ab86
parent96c020611ef9440054b32b94c239b643ff79c7ef (diff)
CIFS: Do not set credits to 1 if the server didn't grant
anything (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-013-CIFS-Do-not-set-credits-to-1-if-the-server-did.patch41
-rw-r--r--series.conf1
2 files changed, 42 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-013-CIFS-Do-not-set-credits-to-1-if-the-server-did.patch b/patches.kernel.org/4.20.3-013-CIFS-Do-not-set-credits-to-1-if-the-server-did.patch
new file mode 100644
index 0000000000..2e3b111a1d
--- /dev/null
+++ b/patches.kernel.org/4.20.3-013-CIFS-Do-not-set-credits-to-1-if-the-server-did.patch
@@ -0,0 +1,41 @@
+From: Pavel Shilovsky <pshilov@microsoft.com>
+Date: Thu, 3 Jan 2019 16:45:13 -0800
+Subject: [PATCH] CIFS: Do not set credits to 1 if the server didn't grant
+ anything
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: 33fa5c8b8a7dbe6353a56eaa654b790348890d42
+
+commit 33fa5c8b8a7dbe6353a56eaa654b790348890d42 upstream.
+
+Currently we reset the number of total credits granted by the server
+to 1 if the server didn't grant us anything int the response. This
+violates the SMB3 protocol - we need to trust the server and use
+the credit values from the response. Fix this by removing the
+corresponding code.
+
+Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+CC: Stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/cifs/transport.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
+index 83ff0c25710d..ddab8c798389 100644
+--- a/fs/cifs/transport.c
++++ b/fs/cifs/transport.c
+@@ -892,8 +892,6 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
+ for (i = 0; i < num_rqst; i++)
+ if (midQ[i]->resp_buf)
+ credits += ses->server->ops->get_credits(midQ[i]);
+- if (!credits)
+- credits = 1;
+
+ for (i = 0; i < num_rqst; i++) {
+ if (rc < 0)
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 762086723c..0c4a6d94a4 100644
--- a/series.conf
+++ b/series.conf
@@ -250,6 +250,7 @@
patches.kernel.org/4.20.3-010-ALSA-hda-realtek-Add-unplug-function-into-unpl.patch
patches.kernel.org/4.20.3-011-ALSA-hda-realtek-Disable-headset-Mic-VREF-for-.patch
patches.kernel.org/4.20.3-012-CIFS-Fix-adjustment-of-credits-for-MTU-request.patch
+ patches.kernel.org/4.20.3-013-CIFS-Do-not-set-credits-to-1-if-the-server-did.patch
########################################################
# Build fixes that apply to the vanilla kernel too.