Commit b7f0554a authored by Dan Williams's avatar Dan Williams Committed by Linus Torvalds

mm: fail get_vaddr_frames() for filesystem-dax mappings

Until there is a solution to the dma-to-dax vs truncate problem it is
not safe to allow V4L2, Exynos, and other frame vector users to create
long standing / irrevocable memory registrations against filesytem-dax

[ add comment for vma_is_fsdax() check in get_vaddr_frames(), per Jan]
Fixes: 3565fce3 ("mm, x86: get_user_pages() for dax mappings")
Signed-off-by: default avatarDan Williams <>
Reviewed-by: default avatarJan Kara <>
Cc: Inki Dae <>
Cc: Seung-Woo Kim <>
Cc: Joonyoung Shim <>
Cc: Kyungmin Park <>
Cc: Mauro Carvalho Chehab <>
Cc: Mel Gorman <>
Cc: Vlastimil Babka <>
Cc: Christoph Hellwig <>
Cc: Doug Ledford <>
Cc: Hal Rosenstock <>
Cc: Jason Gunthorpe <>
Cc: Jeff Moyer <>
Cc: Ross Zwisler <>
Cc: Sean Hefty <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 2bb6d283
......@@ -53,6 +53,18 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
ret = -EFAULT;
goto out;
* While get_vaddr_frames() could be used for transient (kernel
* controlled lifetime) pinning of memory pages all current
* users establish long term (userspace controlled lifetime)
* page pinning. Treat get_vaddr_frames() like
* get_user_pages_longterm() and disallow it for filesystem-dax
* mappings.
if (vma_is_fsdax(vma))
if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) {
vec->got_ref = true;
vec->is_pfns = false;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment