diff options
author | jessicag.feedback@gmail.com <jessicag.feedback@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-03-22 00:29:37 +0000 |
---|---|---|
committer | jessicag.feedback@gmail.com <jessicag.feedback@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-03-22 00:29:37 +0000 |
commit | 322818287c76d89c27feed37c2244580a514637a (patch) | |
tree | 259901f2a30f340dd9cc7af5ee37cb593316ef7a /src/client | |
parent | Issue 417: update unit tests after adding unnamed function detection (diff) | |
download | breakpad-322818287c76d89c27feed37c2244580a514637a.tar.xz |
Add trusted check
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@783 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/linux/handler/exception_handler.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc index 4c7436ea..096ec0d6 100644 --- a/src/client/linux/handler/exception_handler.cc +++ b/src/client/linux/handler/exception_handler.cc @@ -329,8 +329,13 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { if (filter_ && !filter_(callback_context_)) return false; - // Allow ourselves to be dumped. - sys_prctl(PR_SET_DUMPABLE, 1); + // Allow ourselves to be dumped if the signal is trusted. + bool signal_trusted = info->si_code > 0; + bool signal_pid_trusted = info->si_code == SI_USER || + info->si_code == SI_TKILL; + if (signal_trusted || (signal_pid_trusted && info->si_pid == getpid())) { + sys_prctl(PR_SET_DUMPABLE, 1); + } CrashContext context; memcpy(&context.siginfo, info, sizeof(siginfo_t)); memcpy(&context.context, uc, sizeof(struct ucontext)); |