Home Home > GIT Browse > SLE12-SP3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-01-16 20:18:33 +0100
committerTakashi Iwai <tiwai@suse.de>2019-01-16 20:18:33 +0100
commit16aab3e3e6beacf59079d196912cc367799c9e2e (patch)
treef005bb2a9a1b93fabb749e89430236755838cd20
parent89af5e6a2420df6db72292717a9d44a667a1ab2c (diff)
parente3f1063f67c361a3e2ad489f563e1055db69c0d1 (diff)
Merge branch 'users/tabraham/SLE12-SP3/for-next' into SLE12-SP3
Pull aio fix from Thomas Abraham (bsc#1116027)
-rw-r--r--patches.fixes/aio-hold-an-extra-file-reference-over-AIO-read-write.patch44
-rw-r--r--series.conf1
2 files changed, 45 insertions, 0 deletions
diff --git a/patches.fixes/aio-hold-an-extra-file-reference-over-AIO-read-write.patch b/patches.fixes/aio-hold-an-extra-file-reference-over-AIO-read-write.patch
new file mode 100644
index 0000000000..f3fb709487
--- /dev/null
+++ b/patches.fixes/aio-hold-an-extra-file-reference-over-AIO-read-write.patch
@@ -0,0 +1,44 @@
+From 0b944d3a4bba6b25f43aed530f4fa85c04d162a6 Mon Sep 17 00:00:00 2001
+From: Christoph Hellwig <hch@lst.de>
+Date: Sun, 30 Oct 2016 11:42:01 -0500
+Subject: [PATCH] aio: hold an extra file reference over AIO read/write
+ operations
+References: bsc#1116027
+Git-commit: 0b944d3a4bba6b25f43aed530f4fa85c04d162a6
+Patch-mainline: v4.9-rc5
+
+Otherwise we might dereference an already freed file and/or inode
+when aio_complete is called before we return from the read_iter or
+write_iter method.
+
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Thomas Abraham <tabraham@suse.com>
+[tabraham@suse.com: handled backport - minor modification for context]
+---
+ fs/aio.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/fs/aio.c b/fs/aio.c
+index 1157e13a36d6..0aa71d338c04 100644
+--- a/fs/aio.c
++++ b/fs/aio.c
+@@ -1460,6 +1460,7 @@ static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
+
+ len = ret;
+
++ get_file(file);
+ if (rw == WRITE)
+ file_start_write(file);
+
+@@ -1467,6 +1468,7 @@ static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
+
+ if (rw == WRITE)
+ file_end_write(file);
++ fput(file);
+ kfree(iovec);
+ break;
+
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index a38982ed34..47714af32d 100644
--- a/series.conf
+++ b/series.conf
@@ -25266,6 +25266,7 @@
patches.suse/hpwdt-calculate-reload-each-use.patch
patches.suse/hpwdt-add-dynamic-debug.patch
+ patches.fixes/aio-hold-an-extra-file-reference-over-AIO-read-write.patch
########################################################
# You'd better have a good reason for adding a patch
# below here.