diff options
author | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 21:49:51 +0000 |
---|---|---|
committer | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 21:49:51 +0000 |
commit | 9f2974d0cc960e84822aa92e796c838f8d0b622b (patch) | |
tree | b5c68de7e877c0726292b514c584bdbe637d663c /sandbox | |
parent | b1809d2598c2fc3eb7641275c7d9d717d3c020c4 (diff) | |
download | chromium_src-9f2974d0cc960e84822aa92e796c838f8d0b622b.zip chromium_src-9f2974d0cc960e84822aa92e796c838f8d0b622b.tar.gz chromium_src-9f2974d0cc960e84822aa92e796c838f8d0b622b.tar.bz2 |
Always output seccomp error messages to stderr
Also now we always use WriteToStderr and move comments to
appropriate positions.
TEST=trybots
BUG=359285
Review URL: https://codereview.chromium.org/231423002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262829 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc index 6ff7125..4cefa4c 100644 --- a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc +++ b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc @@ -9,7 +9,6 @@ #include <unistd.h> #include "base/basictypes.h" -#include "base/logging.h" #include "base/posix/eintr_wrapper.h" #include "build/build_config.h" #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" @@ -95,11 +94,11 @@ intptr_t CrashSIGSYS_Handler(const struct arch_seccomp_data& args, void* aux) { // TODO(jln): refactor the reporting functions. intptr_t SIGSYSCloneFailure(const struct arch_seccomp_data& args, void* aux) { + static const char kSeccompCloneError[] = + __FILE__":**CRASHING**:clone() failure\n"; + WriteToStdErr(kSeccompCloneError, sizeof(kSeccompCloneError) - 1); // "flags" is the first argument in the kernel's clone(). // Mark as volatile to be able to find the value on the stack in a minidump. -#if !defined(NDEBUG) - RAW_LOG(ERROR, __FILE__":**CRASHING**:clone() failure\n"); -#endif volatile uint64_t clone_flags = args.args[0]; volatile char* addr; if (IsArchitectureX86_64()) { @@ -115,10 +114,10 @@ intptr_t SIGSYSCloneFailure(const struct arch_seccomp_data& args, void* aux) { intptr_t SIGSYSPrctlFailure(const struct arch_seccomp_data& args, void* /* aux */) { + static const char kSeccompPrctlError[] = + __FILE__":**CRASHING**:prctl() failure\n"; + WriteToStdErr(kSeccompPrctlError, sizeof(kSeccompPrctlError) - 1); // Mark as volatile to be able to find the value on the stack in a minidump. -#if !defined(NDEBUG) - RAW_LOG(ERROR, __FILE__":**CRASHING**:prctl() failure\n"); -#endif volatile uint64_t option = args.args[0]; volatile char* addr = reinterpret_cast<volatile char*>(option & 0xFFF); @@ -129,10 +128,10 @@ intptr_t SIGSYSPrctlFailure(const struct arch_seccomp_data& args, intptr_t SIGSYSIoctlFailure(const struct arch_seccomp_data& args, void* /* aux */) { + static const char kSeccompIoctlError[] = + __FILE__":**CRASHING**:ioctl() failure\n"; + WriteToStdErr(kSeccompIoctlError, sizeof(kSeccompIoctlError) - 1); // Make "request" volatile so that we can see it on the stack in a minidump. -#if !defined(NDEBUG) - RAW_LOG(ERROR, __FILE__":**CRASHING**:ioctl() failure\n"); -#endif volatile uint64_t request = args.args[1]; volatile char* addr = reinterpret_cast<volatile char*>(request & 0xFFFF); *addr = '\0'; |