summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pagano <mpagano@gentoo.org>2021-02-09 14:09:13 -0500
committerMike Pagano <mpagano@gentoo.org>2021-02-09 14:09:13 -0500
commitf2b7022ccc048d545f23b383a7716a0cf9c7304f (patch)
treec2438d8d714fad4688466ac154dd37066012b05b
parentLinux patch 5.10.14 (diff)
downloadlinux-patches-f2b7022ccc048d545f23b383a7716a0cf9c7304f.tar.gz
linux-patches-f2b7022ccc048d545f23b383a7716a0cf9c7304f.tar.bz2
linux-patches-f2b7022ccc048d545f23b383a7716a0cf9c7304f.zip
SUNRPC: Fix NFS READs that start at non-page-aligned offsets
See https://bugs.gentoo.org/768720 Thanks to DaggyStyle for reporting and testing Signed-off-by: Mike Pagano <mpagano@gentoo.org>
-rw-r--r--0000_README4
-rw-r--r--2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch53
2 files changed, 57 insertions, 0 deletions
diff --git a/0000_README b/0000_README
index 897c945d..7375e823 100644
--- a/0000_README
+++ b/0000_README
@@ -111,6 +111,10 @@ Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@holtmann.org/raw
Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758
+Patch: 2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch
+From: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/sunrpc/svcsock.c?id=bad4c6eb5eaa8300e065bd4426727db5141d687d
+Desc: SUNRPC: Fix NFS READs that start at non-page-aligned offsets
+
Patch: 2900_tmp513-Fix-build-issue-by-selecting-CONFIG_REG.patch
From: https://bugs.gentoo.org/710790
Desc: tmp513 requies REGMAP_I2C to build. Select it by default in Kconfig. See bug #710790. Thanks to Phil Stracchino
diff --git a/2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch b/2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch
new file mode 100644
index 00000000..34d6ebb7
--- /dev/null
+++ b/2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch
@@ -0,0 +1,53 @@
+From bad4c6eb5eaa8300e065bd4426727db5141d687d Mon Sep 17 00:00:00 2001
+From: Chuck Lever <chuck.lever@oracle.com>
+Date: Sun, 31 Jan 2021 16:16:23 -0500
+Subject: SUNRPC: Fix NFS READs that start at non-page-aligned offsets
+
+Anj Duvnjak reports that the Kodi.tv NFS client is not able to read
+video files from a v5.10.11 Linux NFS server.
+
+The new sendpage-based TCP sendto logic was not attentive to non-
+zero page_base values. nfsd_splice_read() sets that field when a
+READ payload starts in the middle of a page.
+
+The Linux NFS client rarely emits an NFS READ that is not page-
+aligned. All of my testing so far has been with Linux clients, so I
+missed this one.
+
+Reported-by: A. Duvnjak <avian@extremenerds.net>
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211471
+Fixes: 4a85a6a3320b ("SUNRPC: Handle TCP socket sends with kernel_sendpage() again")
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Tested-by: A. Duvnjak <avian@extremenerds.net>
+---
+ net/sunrpc/svcsock.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+(limited to 'net/sunrpc/svcsock.c')
+
+diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
+index c9766d07eb81a..5a809c64dc7b9 100644
+--- a/net/sunrpc/svcsock.c
++++ b/net/sunrpc/svcsock.c
+@@ -1113,14 +1113,15 @@ static int svc_tcp_sendmsg(struct socket *sock, struct msghdr *msg,
+ unsigned int offset, len, remaining;
+ struct bio_vec *bvec;
+
+- bvec = xdr->bvec;
+- offset = xdr->page_base;
++ bvec = xdr->bvec + (xdr->page_base >> PAGE_SHIFT);
++ offset = offset_in_page(xdr->page_base);
+ remaining = xdr->page_len;
+ flags = MSG_MORE | MSG_SENDPAGE_NOTLAST;
+ while (remaining > 0) {
+ if (remaining <= PAGE_SIZE && tail->iov_len == 0)
+ flags = 0;
+- len = min(remaining, bvec->bv_len);
++
++ len = min(remaining, bvec->bv_len - offset);
+ ret = kernel_sendpage(sock, bvec->bv_page,
+ bvec->bv_offset + offset,
+ len, flags);
+--
+cgit 1.2.3-1.el7
+