Chromium Code Reviews| Index: sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc |
| diff --git a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc |
| index 6b959ac928c0091904c4445dc01685e5ff679925..31b784ec679d158c1b3d62b633fe60b122d6d6d8 100644 |
| --- a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc |
| +++ b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc |
| @@ -18,6 +18,7 @@ |
| #define SECCOMP_MESSAGE_PRCTL_CONTENT "prctl() failure" |
| #define SECCOMP_MESSAGE_IOCTL_CONTENT "ioctl() failure" |
| #define SECCOMP_MESSAGE_KILL_CONTENT "(tg)kill() failure" |
| +#define SECCOMP_MESSAGE_FUTEX_CONTENT "futex() failure" |
| namespace { |
| @@ -164,6 +165,18 @@ intptr_t SIGSYSKillFailure(const struct arch_seccomp_data& args, |
| _exit(1); |
| } |
| +intptr_t SIGSYSFutexFailure(const struct arch_seccomp_data& args, |
| + void* /* aux */) { |
| + static const char kSeccompFutexError[] = |
|
Mark Seaborn
2014/06/04 20:29:41
Nit: alignment is off here
jln (very slow on Chromium)
2014/06/04 20:40:16
Done.
|
| + __FILE__":**CRASHING**:" SECCOMP_MESSAGE_FUTEX_CONTENT "\n"; |
| + WriteToStdErr(kSeccompFutexError, sizeof(kSeccompFutexError) - 1); |
| + volatile int futex_op = args.args[1]; |
| + volatile char* addr = reinterpret_cast<volatile char*>(futex_op & 0xFFF); |
| + *addr = '\0'; |
| + for (;;) |
| + _exit(1); |
| +} |
| + |
| const char* GetErrorMessageContentForTests() { |
| return SECCOMP_MESSAGE_COMMON_CONTENT; |
| } |
| @@ -184,4 +197,8 @@ const char* GetKillErrorMessageContentForTests() { |
| return SECCOMP_MESSAGE_KILL_CONTENT; |
| } |
| +const char* GetFutexErrorMessageContentForTests() { |
| + return SECCOMP_MESSAGE_FUTEX_CONTENT; |
| +} |
| + |
| } // namespace sandbox. |