Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Iliopoulos <ailiopoulos@suse.com>2019-03-20 01:04:51 +0100
committerAnthony Iliopoulos <ailiopoulos@suse.com>2019-03-20 01:04:51 +0100
commitb78c8624f20cf958ac577d5a992bfc5df6a5a79d (patch)
tree6eba32aa95c08b845b1f9cfe1568026747eb3473
parent125ebab21611ac389f7ae6152ed747f29476c1ae (diff)
vfs: in iomap seek_{hole,data}, return -ENXIO for negative
offsets (bsc#1070995).
-rw-r--r--patches.fixes/vfs-in-iomap-seek_-hole-data-return-ENXIO-for-negati.patch49
-rw-r--r--series.conf1
2 files changed, 50 insertions, 0 deletions
diff --git a/patches.fixes/vfs-in-iomap-seek_-hole-data-return-ENXIO-for-negati.patch b/patches.fixes/vfs-in-iomap-seek_-hole-data-return-ENXIO-for-negati.patch
new file mode 100644
index 0000000000..e77239e2d9
--- /dev/null
+++ b/patches.fixes/vfs-in-iomap-seek_-hole-data-return-ENXIO-for-negati.patch
@@ -0,0 +1,49 @@
+From d6ab17f261919d212ec0a9e33d01f46df0ec1fde Mon Sep 17 00:00:00 2001
+From: "Darrick J. Wong" <darrick.wong@oracle.com>
+Date: Wed, 12 Jul 2017 10:26:47 -0700
+Subject: [PATCH] vfs: in iomap seek_{hole,data}, return -ENXIO for negative
+ offsets
+Git-commit: d6ab17f261919d212ec0a9e33d01f46df0ec1fde
+Patch-mainline: v4.13-rc1
+References: bsc#1070995
+
+In the iomap implementations of SEEK_HOLE and SEEK_DATA, make sure we
+return -ENXIO for negative offsets.
+
+Inspired-by: Mateusz S <muttdini@gmail.com>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Acked-by: Anthony Iliopoulos <ailiopoulos@suse.com>
+
+---
+ fs/iomap.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/fs/iomap.c b/fs/iomap.c
+index 432eed8f091f..16f5c07451bf 100644
+--- a/fs/iomap.c
++++ b/fs/iomap.c
+@@ -610,8 +610,8 @@ iomap_seek_hole(struct inode *inode, loff_t offset, const struct iomap_ops *ops)
+ loff_t length = size - offset;
+ loff_t ret;
+
+- /* Nothing to be found beyond the end of the file. */
+- if (offset >= size)
++ /* Nothing to be found before or beyond the end of the file. */
++ if (offset < 0 || offset >= size)
+ return -ENXIO;
+
+ while (length > 0) {
+@@ -656,8 +656,8 @@ iomap_seek_data(struct inode *inode, loff_t offset, const struct iomap_ops *ops)
+ loff_t length = size - offset;
+ loff_t ret;
+
+- /* Nothing to be found beyond the end of the file. */
+- if (offset >= size)
++ /* Nothing to be found before or beyond the end of the file. */
++ if (offset < 0 || offset >= size)
+ return -ENXIO;
+
+ while (length > 0) {
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 2d509091ae..f2e0213e3d 100644
--- a/series.conf
+++ b/series.conf
@@ -3898,6 +3898,7 @@
patches.drivers/0009-crypto-cavium-make-several-functions-static.patch
patches.suse/btrfs-incremental-send-fix-invalid-path-for-link-commands.patch
patches.suse/btrfs-fix-unexpected-return-value-of-bio_readpage_error.patch
+ patches.fixes/vfs-in-iomap-seek_-hole-data-return-ENXIO-for-negati.patch
patches.suse/kvm-avoid-unused-variable-warning-for-UP-builds.patch
patches.suse/KVM-vmx-expose-more-information-for-KVM_INTERNAL_ERR.patch
patches.suse/KVM-mark-vcpu-pid-pointer-as-rcu-protected.patch