diff options
author | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 03:40:58 +0000 |
---|---|---|
committer | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 03:40:58 +0000 |
commit | 732c9ffa17022f42d3a6a47c3f75204d18463153 (patch) | |
tree | a0b0e4284408758620f0553c95523f66945f9f31 /sandbox | |
parent | 9d97240cc1763916dc03eb4ee67d7c23eb4fa0c8 (diff) | |
download | chromium_src-732c9ffa17022f42d3a6a47c3f75204d18463153.zip chromium_src-732c9ffa17022f42d3a6a47c3f75204d18463153.tar.gz chromium_src-732c9ffa17022f42d3a6a47c3f75204d18463153.tar.bz2 |
Linux Sandbox: cleanup code around spurious SIGSYS detection.
Sometimes, we receive spurious SIGSYS signals. Clean up this code
a little to make it more clear which problems we're actually seeing.
BUG=178166
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/19054014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211313 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/linux/seccomp-bpf/trap.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc index 85d7d36..78a78ee 100644 --- a/sandbox/linux/seccomp-bpf/trap.cc +++ b/sandbox/linux/seccomp-bpf/trap.cc @@ -124,13 +124,12 @@ void Trap::SigSys(int nr, siginfo_t *info, void *void_context) { // TODO: If we feel confident that our code otherwise works correctly, we // could actually make an argument that spurious SIGSYS should // just get silently ignored. TBD - sigsys_err: - SANDBOX_DIE("Unexpected SIGSYS received"); + SANDBOX_DIE("Unexpected SIGSYS received."); } // Signal handlers should always preserve "errno". Otherwise, we could // trigger really subtle bugs. - int old_errno = errno; + const int old_errno = errno; // Obtain the signal context. This, most notably, gives us access to // all CPU registers at the time of the signal. @@ -146,14 +145,14 @@ void Trap::SigSys(int nr, siginfo_t *info, void *void_context) { if (sigsys.ip != reinterpret_cast<void *>(SECCOMP_IP(ctx)) || sigsys.nr != static_cast<int>(SECCOMP_SYSCALL(ctx)) || sigsys.arch != SECCOMP_ARCH) { - goto sigsys_err; + SANDBOX_DIE("Sanity checks are failing after receiving SIGSYS."); } intptr_t rc; if (has_unsafe_traps_ && GetIsInSigHandler(ctx)) { errno = old_errno; if (sigsys.nr == __NR_clone) { - SANDBOX_DIE("Cannot call clone() from an UnsafeTrap() handler"); + SANDBOX_DIE("Cannot call clone() from an UnsafeTrap() handler."); } rc = SandboxSyscall(sigsys.nr, SECCOMP_PARM1(ctx), SECCOMP_PARM2(ctx), |