From: Greg Kroah-Hartman Date: Fri, 14 Dec 2018 07:23:10 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.19.10~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f46ec7059eae1c0a9d2ecf1eeeea71730baba40;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: dax-check-page-mapping-isn-t-null.patch flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch --- 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 index 00000000000..fa8dfde2eec --- /dev/null +++ b/queue-4.19/dax-check-page-mapping-isn-t-null.patch @@ -0,0 +1,37 @@ +From c93db7bb6ef3251e0ea48ade311d3e9942748e1c Mon Sep 17 00:00:00 2001 +From: Matthew Wilcox +Date: Tue, 27 Nov 2018 13:16:33 -0800 +Subject: dax: Check page->mapping isn't NULL + +From: Matthew Wilcox + +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: +Reported-by: Jan Kara +Signed-off-by: Matthew Wilcox +Reviewed-by: Johannes Thumshirn +Reviewed-by: Jan Kara +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..246597e9a0a --- /dev/null +++ b/queue-4.19/flexfiles-enforce-per-mirror-stateid-only-for-v4-dses.patch @@ -0,0 +1,42 @@ +From 320f35b7bf8cccf1997ca3126843535e1b95e9c4 Mon Sep 17 00:00:00 2001 +From: Tigran Mkrtchyan +Date: Mon, 26 Nov 2018 18:35:14 +0100 +Subject: flexfiles: enforce per-mirror stateid only for v4 DSes + +From: Tigran Mkrtchyan + +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 +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + + /* diff --git a/queue-4.19/ocfs2-fix-potential-use-after-free.patch b/queue-4.19/ocfs2-fix-potential-use-after-free.patch index 246511bc8a7..6f51306ec9a 100644 --- a/queue-4.19/ocfs2-fix-potential-use-after-free.patch +++ b/queue-4.19/ocfs2-fix-potential-use-after-free.patch @@ -23,14 +23,12 @@ Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- - 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 - diff --git a/queue-4.19/series b/queue-4.19/series index ad6d624cd20..88160519674 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -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