Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <sys/epoll.h> | 7 #include <sys/epoll.h> |
| 8 #include <sys/prctl.h> | 8 #include <sys/prctl.h> |
| 9 #include <sys/signal.h> | 9 #include <sys/signal.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 #include "chrome/common/sandbox_methods_linux.h" | 43 #include "chrome/common/sandbox_methods_linux.h" |
| 44 | 44 |
| 45 #include "media/base/media.h" | 45 #include "media/base/media.h" |
| 46 | 46 |
| 47 #include "skia/ext/SkFontHost_fontconfig_control.h" | 47 #include "skia/ext/SkFontHost_fontconfig_control.h" |
| 48 | 48 |
| 49 #include "seccompsandbox/sandbox.h" | 49 #include "seccompsandbox/sandbox.h" |
| 50 | 50 |
| 51 #include "unicode/timezone.h" | 51 #include "unicode/timezone.h" |
| 52 | 52 |
| 53 #if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX) | 53 #if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX) && \ |
| 54 !defined(__clang__) | |
| 54 // The seccomp sandbox is enabled on all ia32 and x86-64 processor as long as | 55 // The seccomp sandbox is enabled on all ia32 and x86-64 processor as long as |
| 55 // we aren't using SELinux. | 56 // we aren't using SELinux or clang. |
|
Nico
2010/09/17 23:52:40
is there a reason for this?
Evan Martin
2010/09/17 23:54:06
Seccomp is really gcc specific right now.
| |
| 56 #define SECCOMP_SANDBOX | 57 #define SECCOMP_SANDBOX |
| 57 #endif | 58 #endif |
| 58 | 59 |
| 59 // http://code.google.com/p/chromium/wiki/LinuxZygote | 60 // http://code.google.com/p/chromium/wiki/LinuxZygote |
| 60 | 61 |
| 61 static const int kBrowserDescriptor = 3; | 62 static const int kBrowserDescriptor = 3; |
| 62 static const int kMagicSandboxIPCDescriptor = 5; | 63 static const int kMagicSandboxIPCDescriptor = 5; |
| 63 static const int kZygoteIdDescriptor = 7; | 64 static const int kZygoteIdDescriptor = 7; |
| 64 static bool g_suid_sandbox_active = false; | 65 static bool g_suid_sandbox_active = false; |
| 65 #if defined(SECCOMP_SANDBOX) | 66 #if defined(SECCOMP_SANDBOX) |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 740 LOG(INFO) << "Enabling experimental Seccomp sandbox."; | 741 LOG(INFO) << "Enabling experimental Seccomp sandbox."; |
| 741 sandbox_flags |= ZygoteHost::kSandboxSeccomp; | 742 sandbox_flags |= ZygoteHost::kSandboxSeccomp; |
| 742 } | 743 } |
| 743 } | 744 } |
| 744 #endif // SECCOMP_SANDBOX | 745 #endif // SECCOMP_SANDBOX |
| 745 | 746 |
| 746 Zygote zygote(sandbox_flags); | 747 Zygote zygote(sandbox_flags); |
| 747 // This function call can return multiple times, once per fork(). | 748 // This function call can return multiple times, once per fork(). |
| 748 return zygote.ProcessRequests(); | 749 return zygote.ProcessRequests(); |
| 749 } | 750 } |
| OLD | NEW |