]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Sat, 15 Oct 2022 11:24:50 +0000 (07:24 -0400)
committerSasha Levin <sashal@kernel.org>
Sat, 15 Oct 2022 11:24:50 +0000 (07:24 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch b/queue-4.14/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch
new file mode 100644 (file)
index 0000000..ee39fce
--- /dev/null
@@ -0,0 +1,47 @@
+From cebd5515812913a991f65d603ecee196d3f518ca Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 15 Oct 2022 07:18:38 -0400
+Subject: Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
+
+This reverts commit fd0a6e99b61e6c08fa5cf585d54fd956f70c73a6.
+
+Which was upstream commit 97ef77c52b789ec1411d360ed99dca1efe4b2c81.
+
+The commit is missing dependencies and breaks NFS tests, remove it for
+now.
+
+Reported-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/splice.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/fs/splice.c b/fs/splice.c
+index 04d25af25a42..c84ac7e97e21 100644
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -898,15 +898,17 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
+ {
+       struct pipe_inode_info *pipe;
+       long ret, bytes;
++      umode_t i_mode;
+       size_t len;
+       int i, flags, more;
+       /*
+-       * We require the input to be seekable, as we don't want to randomly
+-       * drop data for eg socket -> socket splicing. Use the piped splicing
+-       * for that!
++       * We require the input being a regular file, as we don't want to
++       * randomly drop data for eg socket -> socket splicing. Use the
++       * piped splicing for that!
+        */
+-      if (unlikely(!(in->f_mode & FMODE_LSEEK)))
++      i_mode = file_inode(in)->i_mode;
++      if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode)))
+               return -EINVAL;
+       /*
+-- 
+2.35.1
+
index 0d5b18d44f4d71b84b2df471d778f255f3cfda53..f47f496baa394e7472ba734fc065bba039692fb0 100644 (file)
@@ -47,3 +47,4 @@ wifi-mac80211_hwsim-avoid-mac80211-warning-on-bad-rate.patch
 input-xpad-add-supported-devices-as-contributed-on-github.patch
 input-xpad-fix-wireless-360-controller-breaking-after-suspend.patch
 random-use-expired-timer-rather-than-wq-for-mixing-fast-pool.patch
+revert-fs-check-fmode_lseek-to-control-internal-pipe.patch