aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorKawai, Hidehiro <hidehiro.kawai.ez@hitachi.com>2007-07-19 04:48:28 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:47 -0400
commit3cb4a0bb1e773e3c41800b33a3f7dab32bd06c64 (patch)
treed363522865706f0674b7b104a8fc7b151f336764 /kernel/fork.c
parent6c5d523826dc639df709ed0f88c5d2ce25379652 (diff)
coredump masking: add an interface for core dump filter
This patch adds an interface to set/reset flags which determines each memory segment should be dumped or not when a core file is generated. /proc/<pid>/coredump_filter file is provided to access the flags. You can change the flag status for a particular process by writing to or reading from the file. The flag status is inherited to the child process when it is created. Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: David Howells <dhowells@redhat.com> Cc: Hugh Dickins <hugh@veritas.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index ba39bdb2a7b8..469838998220 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -334,6 +334,8 @@ static struct mm_struct * mm_init(struct mm_struct * mm)
334 atomic_set(&mm->mm_count, 1); 334 atomic_set(&mm->mm_count, 1);
335 init_rwsem(&mm->mmap_sem); 335 init_rwsem(&mm->mmap_sem);
336 INIT_LIST_HEAD(&mm->mmlist); 336 INIT_LIST_HEAD(&mm->mmlist);
337 mm->flags = (current->mm) ? current->mm->flags
338 : MMF_DUMP_FILTER_DEFAULT;
337 mm->core_waiters = 0; 339 mm->core_waiters = 0;
338 mm->nr_ptes = 0; 340 mm->nr_ptes = 0;
339 set_mm_counter(mm, file_rss, 0); 341 set_mm_counter(mm, file_rss, 0);