summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf_fdpic.c
diff options
context:
space:
mode:
authorRoss Zwisler <ross.zwisler@linux.intel.com>2015-10-05 16:33:37 -0600
committerDan Williams <dan.j.williams@intel.com>2015-11-09 13:29:54 -0500
commitab27a8d04b32b6ee8c30c14c4afd1058e8addc82 (patch)
tree5a6a52a6d752b1aa001db22a7c1bfac30d844966 /fs/binfmt_elf_fdpic.c
parent5037835c1f3eabf4f22163fc0278dd87165f8957 (diff)
downloadlinux-stable-ab27a8d04b32b6ee8c30c14c4afd1058e8addc82.tar.gz
linux-stable-ab27a8d04b32b6ee8c30c14c4afd1058e8addc82.tar.bz2
linux-stable-ab27a8d04b32b6ee8c30c14c4afd1058e8addc82.zip
coredump: add DAX filtering for FDPIC ELF coredumps
Add explicit filtering for DAX mappings to FDPIC ELF coredump. This is useful because DAX mappings have the potential to be very large. This patch has only been compile tested. Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/binfmt_elf_fdpic.c')
-rw-r--r--fs/binfmt_elf_fdpic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index d3634bfb7fe1..863250157aa7 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -35,6 +35,7 @@
#include <linux/elf-fdpic.h>
#include <linux/elfcore.h>
#include <linux/coredump.h>
+#include <linux/dax.h>
#include <asm/uaccess.h>
#include <asm/param.h>
@@ -1206,6 +1207,20 @@ static int maydump(struct vm_area_struct *vma, unsigned long mm_flags)
return 0;
}
+ /* support for DAX */
+ if (vma_is_dax(vma)) {
+ if (vma->vm_flags & VM_SHARED) {
+ dump_ok = test_bit(MMF_DUMP_DAX_SHARED, &mm_flags);
+ kdcore("%08lx: %08lx: %s (DAX shared)", vma->vm_start,
+ vma->vm_flags, dump_ok ? "yes" : "no");
+ } else {
+ dump_ok = test_bit(MMF_DUMP_DAX_PRIVATE, &mm_flags);
+ kdcore("%08lx: %08lx: %s (DAX private)", vma->vm_start,
+ vma->vm_flags, dump_ok ? "yes" : "no");
+ }
+ return dump_ok;
+ }
+
/* By default, dump shared memory if mapped from an anonymous file. */
if (vma->vm_flags & VM_SHARED) {
if (file_inode(vma->vm_file)->i_nlink == 0) {