summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds2017-08-26 03:02:27 +0200
committerLinus Torvalds2017-08-26 03:02:27 +0200
commitb3242dba9ff285962fe84d1135cafe9383d721f0 (patch)
treecf4399b9a45bca863a0b404bfc7edfeff670ab1e /fs
parentMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm (diff)
parentmm/memblock.c: reversed logic in memblock_discard() (diff)
downloadkernel-qcow2-linux-b3242dba9ff285962fe84d1135cafe9383d721f0.tar.gz
kernel-qcow2-linux-b3242dba9ff285962fe84d1135cafe9383d721f0.tar.xz
kernel-qcow2-linux-b3242dba9ff285962fe84d1135cafe9383d721f0.zip
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "6 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: mm/memblock.c: reversed logic in memblock_discard() fork: fix incorrect fput of ->exe_file causing use-after-free mm/madvise.c: fix freeing of locked page with MADV_FREE dax: fix deadlock due to misaligned PMD faults mm, shmem: fix handling /sys/kernel/mm/transparent_hugepage/shmem_enabled PM/hibernate: touch NMI watchdog when creating snapshot
Diffstat (limited to 'fs')
-rw-r--r--fs/dax.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 306c2b603fb8..865d42c63e23 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1383,6 +1383,16 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf,
trace_dax_pmd_fault(inode, vmf, max_pgoff, 0);
+ /*
+ * Make sure that the faulting address's PMD offset (color) matches
+ * the PMD offset from the start of the file. This is necessary so
+ * that a PMD range in the page table overlaps exactly with a PMD
+ * range in the radix tree.
+ */
+ if ((vmf->pgoff & PG_PMD_COLOUR) !=
+ ((vmf->address >> PAGE_SHIFT) & PG_PMD_COLOUR))
+ goto fallback;
+
/* Fall back to PTEs if we're going to COW */
if (write && !(vma->vm_flags & VM_SHARED))
goto fallback;