]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Dec 2018 07:23:10 +0000 (08:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Dec 2018 07:23:10 +0000 (08:23 +0100)
added patches:
dax-check-page-mapping-isn-t-null.patch
flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch

queue-4.19/dax-check-page-mapping-isn-t-null.patch [new file with mode: 0644]
queue-4.19/flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch [new file with mode: 0644]
queue-4.19/ocfs2-fix-potential-use-after-free.patch
queue-4.19/series

diff --git a/queue-4.19/dax-check-page-mapping-isn-t-null.patch b/queue-4.19/dax-check-page-mapping-isn-t-null.patch
new file mode 100644 (file)
index 0000000..fa8dfde
--- /dev/null
@@ -0,0 +1,37 @@
+From c93db7bb6ef3251e0ea48ade311d3e9942748e1c Mon Sep 17 00:00:00 2001
+From: Matthew Wilcox <willy@infradead.org>
+Date: Tue, 27 Nov 2018 13:16:33 -0800
+Subject: dax: Check page->mapping isn't NULL
+
+From: Matthew Wilcox <willy@infradead.org>
+
+commit c93db7bb6ef3251e0ea48ade311d3e9942748e1c upstream.
+
+If we race with inode destroy, it's possible for page->mapping to be
+NULL before we even enter this routine, as well as after having slept
+waiting for the dax entry to become unlocked.
+
+Fixes: c2a7d2a11552 ("filesystem-dax: Introduce dax_lock_mapping_entry()")
+Cc: <stable@vger.kernel.org>
+Reported-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Matthew Wilcox <willy@infradead.org>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/dax.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/dax.c
++++ b/fs/dax.c
+@@ -423,7 +423,7 @@ bool dax_lock_mapping_entry(struct page
+       for (;;) {
+               mapping = READ_ONCE(page->mapping);
+-              if (!dax_mapping(mapping))
++              if (!mapping || !dax_mapping(mapping))
+                       break;
+               /*
diff --git a/queue-4.19/flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch b/queue-4.19/flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch
new file mode 100644 (file)
index 0000000..246597e
--- /dev/null
@@ -0,0 +1,42 @@
+From 320f35b7bf8cccf1997ca3126843535e1b95e9c4 Mon Sep 17 00:00:00 2001
+From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
+Date: Mon, 26 Nov 2018 18:35:14 +0100
+Subject: flexfiles: enforce per-mirror stateid only for v4 DSes
+
+From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
+
+commit 320f35b7bf8cccf1997ca3126843535e1b95e9c4 upstream.
+
+Since commit bb21ce0ad227 we always enforce per-mirror stateid.
+However, this makes sense only for v4+ servers.
+
+Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/flexfilelayout/flexfilelayout.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/fs/nfs/flexfilelayout/flexfilelayout.c
++++ b/fs/nfs/flexfilelayout/flexfilelayout.c
+@@ -1733,7 +1733,8 @@ ff_layout_read_pagelist(struct nfs_pgio_
+       if (fh)
+               hdr->args.fh = fh;
+-      if (!nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
++      if (vers == 4 &&
++              !nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
+               goto out_failed;
+       /*
+@@ -1798,7 +1799,8 @@ ff_layout_write_pagelist(struct nfs_pgio
+       if (fh)
+               hdr->args.fh = fh;
+-      if (!nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
++      if (vers == 4 &&
++              !nfs4_ff_layout_select_ds_stateid(lseg, idx, &hdr->args.stateid))
+               goto out_failed;
+       /*
index 246511bc8a7987cefe91baf618bfe3d56f6995ff..6f51306ec9aa6f2e70221ef886ae38cbd9510204 100644 (file)
@@ -23,14 +23,12 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- fs/ocfs2/export.c | 2 +-
+ fs/ocfs2/export.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
-index 9f88188060db..4bf8d5854b27 100644
 --- a/fs/ocfs2/export.c
 +++ b/fs/ocfs2/export.c
-@@ -125,10 +125,10 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
+@@ -125,10 +125,10 @@ check_err:
  
  check_gen:
        if (handle->ih_generation != inode->i_generation) {
@@ -42,6 +40,3 @@ index 9f88188060db..4bf8d5854b27 100644
                result = ERR_PTR(-ESTALE);
                goto bail;
        }
--- 
-2.19.1
-
index ad6d624cd200a1a8195161ade36fd3a307f7b8d5..881605196749162c6c39dc7ab78f7557c4d63a88 100644 (file)
@@ -130,3 +130,5 @@ proc-fixup-map_files-test-on-arm.patch
 kernel-kcov.c-mark-funcs-in-__sanitizer_cov_trace_pc.patch
 initramfs-clean-old-path-before-creating-a-hardlink.patch
 ocfs2-fix-potential-use-after-free.patch
+flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch
+dax-check-page-mapping-isn-t-null.patch