diff options
author | Kawai, Hidehiro <hidehiro.kawai.ez@hitachi.com> | 2007-07-19 04:48:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:47 -0400 |
commit | 3cb4a0bb1e773e3c41800b33a3f7dab32bd06c64 (patch) | |
tree | d363522865706f0674b7b104a8fc7b151f336764 /include/linux/sched.h | |
parent | 6c5d523826dc639df709ed0f88c5d2ce25379652 (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 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8dbd08366400..94f624aef017 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -349,8 +349,22 @@ extern void set_dumpable(struct mm_struct *mm, int value); | |||
349 | extern int get_dumpable(struct mm_struct *mm); | 349 | extern int get_dumpable(struct mm_struct *mm); |
350 | 350 | ||
351 | /* mm flags */ | 351 | /* mm flags */ |
352 | /* dumpable bits */ | ||
352 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | 353 | #define MMF_DUMPABLE 0 /* core dump is permitted */ |
353 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ | 354 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ |
355 | #define MMF_DUMPABLE_BITS 2 | ||
356 | |||
357 | /* coredump filter bits */ | ||
358 | #define MMF_DUMP_ANON_PRIVATE 2 | ||
359 | #define MMF_DUMP_ANON_SHARED 3 | ||
360 | #define MMF_DUMP_MAPPED_PRIVATE 4 | ||
361 | #define MMF_DUMP_MAPPED_SHARED 5 | ||
362 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS | ||
363 | #define MMF_DUMP_FILTER_BITS 4 | ||
364 | #define MMF_DUMP_FILTER_MASK \ | ||
365 | (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT) | ||
366 | #define MMF_DUMP_FILTER_DEFAULT \ | ||
367 | ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED)) | ||
354 | 368 | ||
355 | struct mm_struct { | 369 | struct mm_struct { |
356 | struct vm_area_struct * mmap; /* list of VMAs */ | 370 | struct vm_area_struct * mmap; /* list of VMAs */ |