aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Zwisler <ross.zwisler@linux.intel.com>2015-10-05 18:33:37 -0400
committerDan Williams <dan.j.williams@intel.com>2015-11-09 13:29:54 -0500
commitab27a8d04b32b6ee8c30c14c4afd1058e8addc82 (patch)
tree5a6a52a6d752b1aa001db22a7c1bfac30d844966
parent5037835c1f3eabf4f22163fc0278dd87165f8957 (diff)
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>
-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 @@
35#include <linux/elf-fdpic.h> 35#include <linux/elf-fdpic.h>
36#include <linux/elfcore.h> 36#include <linux/elfcore.h>
37#include <linux/coredump.h> 37#include <linux/coredump.h>
38#include <linux/dax.h>
38 39
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40#include <asm/param.h> 41#include <asm/param.h>
@@ -1206,6 +1207,20 @@ static int maydump(struct vm_area_struct *vma, unsigned long mm_flags)
1206 return 0; 1207 return 0;
1207 } 1208 }
1208 1209
1210 /* support for DAX */
1211 if (vma_is_dax(vma)) {
1212 if (vma->vm_flags & VM_SHARED) {
1213 dump_ok = test_bit(MMF_DUMP_DAX_SHARED, &mm_flags);
1214 kdcore("%08lx: %08lx: %s (DAX shared)", vma->vm_start,
1215 vma->vm_flags, dump_ok ? "yes" : "no");
1216 } else {
1217 dump_ok = test_bit(MMF_DUMP_DAX_PRIVATE, &mm_flags);
1218 kdcore("%08lx: %08lx: %s (DAX private)", vma->vm_start,
1219 vma->vm_flags, dump_ok ? "yes" : "no");
1220 }
1221 return dump_ok;
1222 }
1223
1209 /* By default, dump shared memory if mapped from an anonymous file. */ 1224 /* By default, dump shared memory if mapped from an anonymous file. */
1210 if (vma->vm_flags & VM_SHARED) { 1225 if (vma->vm_flags & VM_SHARED) {
1211 if (file_inode(vma->vm_file)->i_nlink == 0) { 1226 if (file_inode(vma->vm_file)->i_nlink == 0) {