From f58750e12d13b11ab15eee0aeda41e31916bc664 Mon Sep 17 00:00:00 2001 From: Yves-Alexis Perez Date: Tue, 1 Jan 2019 20:37:41 +0100 Subject: [PATCH] smb3: fix large reads on encrypted connections --- debian/changelog | 3 ++ ...large-reads-on-encrypted-connections.patch | 41 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 45 insertions(+) create mode 100644 debian/patches/bugfix/all/smb3-fix-large-reads-on-encrypted-connections.patch diff --git a/debian/changelog b/debian/changelog index c9c11846c..2a8a6ea8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,9 @@ linux (4.19.13-2) UNRELEASED; urgency=medium * Add pkg.linux.nokernel build profile that excludes kernel image and header packages + [ Yves-Alexis Perez ] + * smb3: fix large reads on encrypted connections + -- John Paul Adrian Glaubitz Sun, 30 Dec 2018 10:30:57 +0100 linux (4.19.13-1) unstable; urgency=medium diff --git a/debian/patches/bugfix/all/smb3-fix-large-reads-on-encrypted-connections.patch b/debian/patches/bugfix/all/smb3-fix-large-reads-on-encrypted-connections.patch new file mode 100644 index 000000000..bf0bc4fd8 --- /dev/null +++ b/debian/patches/bugfix/all/smb3-fix-large-reads-on-encrypted-connections.patch @@ -0,0 +1,41 @@ +From: Paul Aurich +Date: Mon, 31 Dec 2018 14:13:34 -0800 +Subject: smb3: fix large reads on encrypted connections +Origin: https://git.samba.org/?p=sfrench/cifs-2.6.git;a=commit;h=1f4b6df1eaa55d2dcedd7a3351568c7a2aa42d2d + +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 +Tested-by: Yves-Alexis Perez +Signed-off-by: Steve French +--- + 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 --git a/debian/patches/series b/debian/patches/series index 2272e5f7d..90eace6b5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -100,6 +100,7 @@ bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch +bugfix/all/smb3-fix-large-reads-on-encrypted-connections.patch # Miscellaneous features