Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab27a8d0 authored by Ross Zwisler's avatar Ross Zwisler Committed by Dan Williams
Browse files

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: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Acked-by: default avatarJeff Moyer <jmoyer@redhat.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5037835c
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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) {