linux/arch/s390/kernel
Jason Baron 909af768e8 coredump: remove VM_ALWAYSDUMP flag
The motivation for this patchset was that I was looking at a way for a
qemu-kvm process, to exclude the guest memory from its core dump, which
can be quite large.  There are already a number of filter flags in
/proc/<pid>/coredump_filter, however, these allow one to specify 'types'
of kernel memory, not specific address ranges (which is needed in this
case).

Since there are no more vma flags available, the first patch eliminates
the need for the 'VM_ALWAYSDUMP' flag.  The flag is used internally by
the kernel to mark vdso and vsyscall pages.  However, it is simple
enough to check if a vma covers a vdso or vsyscall page without the need
for this flag.

The second patch then replaces the 'VM_ALWAYSDUMP' flag with a new
'VM_NODUMP' flag, which can be set by userspace using new madvise flags:
'MADV_DONTDUMP', and unset via 'MADV_DODUMP'.  The core dump filters
continue to work the same as before unless 'MADV_DONTDUMP' is set on the
region.

The qemu code which implements this features is at:

  http://people.redhat.com/~jbaron/qemu-dump/qemu-dump.patch

In my testing the qemu core dump shrunk from 383MB -> 13MB with this
patch.

I also believe that the 'MADV_DONTDUMP' flag might be useful for
security sensitive apps, which might want to select which areas are
dumped.

This patch:

The VM_ALWAYSDUMP flag is currently used by the coredump code to
indicate that a vma is part of a vsyscall or vdso section.  However, we
can determine if a vma is in one these sections by checking it against
the gate_vma and checking for a non-NULL return value from
arch_vma_name().  Thus, freeing a valuable vma bit.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Roland McGrath <roland@hack.frob.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-23 16:58:42 -07:00
..
vdso32
vdso64
Makefile [S390] kernel: Add OS info memory interface 2012-03-11 11:59:29 -04:00
asm-offsets.c [S390] rework idle code 2012-03-11 11:59:28 -04:00
audit.c
audit.h
base.S [S390] entry[64].S improvements 2011-12-27 11:27:12 +01:00
bitmap.c
compat_audit.c
compat_exec_domain.c
compat_linux.c [S390] ipc: call generic sys_ipc demultiplexer 2011-12-27 11:27:13 +01:00
compat_linux.h
compat_ptrace.h
compat_signal.c [S390] Use block_sigmask() 2012-03-11 11:59:29 -04:00
compat_wrapper.S sys_poll: fix incorrect type for 'timeout' parameter 2012-02-21 17:24:20 -08:00
cpcmd.c
crash.c
crash_dump.c [S390] kernel: Add OS info memory interface 2012-03-11 11:59:29 -04:00
debug.c [S390] kernel: Add z/VM LGR detection 2012-03-11 11:59:29 -04:00
diag.c
dis.c [S390] disassembler: mark exception causing instructions 2011-12-27 11:27:14 +01:00
early.c [S390] kernel: Add z/VM LGR detection 2012-03-11 11:59:29 -04:00
ebcdic.c
entry.S [S390] rework idle code 2012-03-11 11:59:28 -04:00
entry.h [S390] irq: external interrupt code passing 2012-03-11 11:59:29 -04:00
entry64.S [S390] rework idle code 2012-03-11 11:59:28 -04:00
ftrace.c
head.S [S390] entry[64].S improvements 2011-12-27 11:27:12 +01:00
head31.S [S390] smp: external call vs. emergency signal 2011-10-30 15:16:44 +01:00
head64.S [S390] smp: external call vs. emergency signal 2011-10-30 15:16:44 +01:00
head_kdump.S [S390] kdump backend code 2011-10-30 15:16:42 +01:00
init_task.c
ipl.c [S390] kernel: Add OS info memory interface 2012-03-11 11:59:29 -04:00
irq.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-22 18:15:32 -07:00
jump_label.c s390/jump-label: add arch_jump_label_transform_static() 2011-10-25 11:54:37 -07:00
kprobes.c [S390] sparse: fix sparse static warnings 2011-10-30 15:16:46 +01:00
lgr.c [S390] kernel: Add z/VM LGR detection 2012-03-11 11:59:29 -04:00
machine_kexec.c [S390] kernel: Add z/VM LGR detection 2012-03-11 11:59:29 -04:00
mcount.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
mcount64.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
mem_detect.c [S390] Rework create_mem_hole() function 2011-12-27 11:27:09 +01:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
nmi.c [S390] rework idle code 2012-03-11 11:59:28 -04:00
os_info.c [S390] kernel: Add OS info memory interface 2012-03-11 11:59:29 -04:00
process.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-22 18:15:32 -07:00
processor.c [S390] avoid warning in show_cpuinfo 2011-10-30 15:16:15 +01:00
ptrace.c compat: fix compile breakage on s390 2012-02-27 07:54:27 -08:00
reipl.S [S390] kdump backend code 2011-10-30 15:16:42 +01:00
reipl64.S [S390] entry[64].S improvements 2011-12-27 11:27:12 +01:00
relocate_kernel.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
relocate_kernel64.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
s390_ksyms.c [S390] move sie code to entry.S 2011-07-24 10:48:21 +02:00
sclp.S [S390] fix s390 assembler code alignments 2011-07-24 10:48:21 +02:00
setup.c [S390] kernel: Add OS info memory interface 2012-03-11 11:59:29 -04:00
signal.c [S390] Use block_sigmask() 2012-03-11 11:59:29 -04:00
smp.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-22 18:15:32 -07:00
stacktrace.c
suspend.c [S390] sparse: fix sparse warnings about missing prototypes 2011-10-30 15:16:46 +01:00
swsusp_asm64.S [S390] kernel: Add z/VM LGR detection 2012-03-11 11:59:29 -04:00
sys_s390.c [S390] ipc: call generic sys_ipc demultiplexer 2011-12-27 11:27:13 +01:00
syscalls.S [S390] wire up process_vm syscalls 2011-11-14 11:19:08 +01:00
sysinfo.c [S390] sparse: fix sparse warnings in math-emu 2011-10-30 15:16:46 +01:00
time.c [S390] irq: external interrupt code passing 2012-03-11 11:59:29 -04:00
topology.c [S390] rework smp code 2012-03-11 11:59:28 -04:00
traps.c [S390] stack dump: fix indentation in output 2012-03-11 11:59:29 -04:00
vdso.c coredump: remove VM_ALWAYSDUMP flag 2012-03-23 16:58:42 -07:00
vmlinux.lds.S [S390] cleanup entry point definition 2012-01-18 18:03:41 +01:00
vtime.c [S390] irq: external interrupt code passing 2012-03-11 11:59:29 -04:00