[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 1 | # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | import("//build/config/features.gni") |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 6 | import("//build/config/nacl/config.gni") |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 7 | import("//testing/test.gni") |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 8 | |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 9 | declare_args() { |
| 10 | compile_suid_client = is_linux |
| 11 | |
| 12 | compile_credentials = is_linux |
| 13 | |
jln | 01954fd | 2015-05-15 06:19:33 | [diff] [blame] | 14 | # On Android, use plain GTest. |
| 15 | use_base_test_suite = is_linux |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 16 | } |
| 17 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 18 | if (is_nacl_nonsfi) { |
| 19 | config("nacl_nonsfi_warnings") { |
| 20 | # There are number of platform specific functions in |
| 21 | # seccomp-bpf syscall helpers, which are not being used. |
| 22 | cflags = [ "-Wno-unused-function" ] |
| 23 | } |
| 24 | } |
| 25 | |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 26 | # We have two principal targets: sandbox and sandbox_linux_unittests |
| 27 | # All other targets are listed as dependencies. |
| 28 | # There is one notable exception: for historical reasons, chrome_sandbox is |
| 29 | # the setuid sandbox and is its own target. |
| 30 | |
| 31 | group("sandbox") { |
| 32 | deps = [ |
| 33 | ":sandbox_services", |
| 34 | ] |
| 35 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 36 | if (compile_suid_client || is_nacl_nonsfi) { |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 37 | deps += [ ":suid_sandbox_client" ] |
| 38 | } |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 39 | if (use_seccomp_bpf || is_nacl_nonsfi) { |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 40 | deps += [ |
| 41 | ":seccomp_bpf", |
| 42 | ":seccomp_bpf_helpers", |
| 43 | ] |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | source_set("sandbox_linux_test_utils") { |
Brett Wilson | 0c8745a | 2014-09-08 22:59:49 | [diff] [blame] | 48 | testonly = true |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 49 | sources = [ |
| 50 | "tests/sandbox_test_runner.cc", |
| 51 | "tests/sandbox_test_runner.h", |
| 52 | "tests/sandbox_test_runner_function_pointer.cc", |
| 53 | "tests/sandbox_test_runner_function_pointer.h", |
| 54 | "tests/test_utils.cc", |
| 55 | "tests/test_utils.h", |
| 56 | "tests/unit_tests.cc", |
| 57 | "tests/unit_tests.h", |
| 58 | ] |
| 59 | |
| 60 | deps = [ |
| 61 | "//testing/gtest", |
| 62 | ] |
| 63 | |
| 64 | if (use_seccomp_bpf) { |
| 65 | sources += [ |
| 66 | "seccomp-bpf/bpf_tester_compatibility_delegate.h", |
| 67 | "seccomp-bpf/bpf_tests.h", |
| 68 | "seccomp-bpf/sandbox_bpf_test_runner.cc", |
| 69 | "seccomp-bpf/sandbox_bpf_test_runner.h", |
| 70 | ] |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 71 | deps += [ ":seccomp_bpf" ] |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 72 | } |
jln | 01954fd | 2015-05-15 06:19:33 | [diff] [blame] | 73 | |
| 74 | if (use_base_test_suite) { |
| 75 | deps += [ "//base/test:test_support" ] |
| 76 | defines = [ "SANDBOX_USES_BASE_TEST_SUITE" ] |
| 77 | } |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 78 | } |
| 79 | |
pkotwicz | 41889e3 | 2015-10-28 22:17:48 | [diff] [blame^] | 80 | # Sources for sandbox_linux_unittests. |
rockot | 86da06c7f | 2015-02-21 00:40:58 | [diff] [blame] | 81 | source_set("sandbox_linux_unittests_sources") { |
| 82 | testonly = true |
| 83 | |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 84 | sources = [ |
jln | b14fc80 | 2015-02-12 05:32:11 | [diff] [blame] | 85 | "services/proc_util_unittest.cc", |
jln | 97718598 | 2015-02-13 20:58:41 | [diff] [blame] | 86 | "services/resource_limits_unittests.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 87 | "services/scoped_process_unittest.cc", |
jln | c420f0d | 2014-11-22 01:12:09 | [diff] [blame] | 88 | "services/syscall_wrappers_unittest.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 89 | "services/thread_helpers_unittests.cc", |
| 90 | "services/yama_unittests.cc", |
leecam | ad78f42 | 2014-11-26 22:08:45 | [diff] [blame] | 91 | "syscall_broker/broker_file_permission_unittest.cc", |
jln | 70c42c20 | 2014-11-01 00:59:57 | [diff] [blame] | 92 | "syscall_broker/broker_process_unittest.cc", |
[email protected] | 232f6e11 | 2014-06-27 07:51:38 | [diff] [blame] | 93 | "tests/main.cc", |
| 94 | "tests/scoped_temporary_file.cc", |
| 95 | "tests/scoped_temporary_file.h", |
| 96 | "tests/scoped_temporary_file_unittest.cc", |
jln | c420f0d | 2014-11-22 01:12:09 | [diff] [blame] | 97 | "tests/test_utils_unittest.cc", |
[email protected] | 232f6e11 | 2014-06-27 07:51:38 | [diff] [blame] | 98 | "tests/unit_tests_unittest.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 99 | ] |
| 100 | |
| 101 | deps = [ |
| 102 | ":sandbox", |
| 103 | ":sandbox_linux_test_utils", |
| 104 | "//base", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 105 | "//testing/gtest", |
| 106 | ] |
| 107 | |
jln | 01954fd | 2015-05-15 06:19:33 | [diff] [blame] | 108 | if (use_base_test_suite) { |
| 109 | deps += [ "//base/test:test_support" ] |
| 110 | defines = [ "SANDBOX_USES_BASE_TEST_SUITE" ] |
| 111 | } |
| 112 | |
Brett Wilson | 7306753 | 2014-09-12 22:24:14 | [diff] [blame] | 113 | if (is_linux) { |
| 114 | # Don't use this on Android. |
| 115 | libs = [ "rt" ] |
| 116 | } |
Brett Wilson | e3934435 | 2014-09-12 21:07:26 | [diff] [blame] | 117 | |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 118 | if (compile_suid_client) { |
mdempsky | 3cc942a | 2015-02-05 03:29:25 | [diff] [blame] | 119 | sources += [ |
| 120 | "suid/client/setuid_sandbox_client_unittest.cc", |
| 121 | "suid/client/setuid_sandbox_host_unittest.cc", |
| 122 | ] |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 123 | } |
| 124 | if (use_seccomp_bpf) { |
| 125 | sources += [ |
[email protected] | fb75e2a | 2014-07-17 07:24:58 | [diff] [blame] | 126 | "bpf_dsl/bpf_dsl_unittest.cc", |
mdempsky | b80b1f5 | 2015-02-05 00:54:35 | [diff] [blame] | 127 | "bpf_dsl/codegen_unittest.cc", |
[email protected] | fb75e2a | 2014-07-17 07:24:58 | [diff] [blame] | 128 | "bpf_dsl/cons_unittest.cc", |
mdempsky | 937389d | 2015-08-31 22:27:23 | [diff] [blame] | 129 | "bpf_dsl/dump_bpf.cc", |
| 130 | "bpf_dsl/dump_bpf.h", |
mdempsky | ce4c9f1 | 2015-02-05 06:23:05 | [diff] [blame] | 131 | "bpf_dsl/syscall_set_unittest.cc", |
mdempsky | 3909ebf | 2015-08-20 23:18:18 | [diff] [blame] | 132 | "bpf_dsl/test_trap_registry.cc", |
| 133 | "bpf_dsl/test_trap_registry.h", |
| 134 | "bpf_dsl/test_trap_registry_unittest.cc", |
mdempsky | 937389d | 2015-08-31 22:27:23 | [diff] [blame] | 135 | "bpf_dsl/verifier.cc", |
| 136 | "bpf_dsl/verifier.h", |
jln | aedcc3e | 2015-02-12 03:18:10 | [diff] [blame] | 137 | "integration_tests/bpf_dsl_seccomp_unittest.cc", |
| 138 | "integration_tests/seccomp_broker_process_unittest.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 139 | "seccomp-bpf-helpers/baseline_policy_unittest.cc", |
jln | fcdfb10 | 2014-09-12 02:47:44 | [diff] [blame] | 140 | "seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 141 | "seccomp-bpf/bpf_tests_unittest.cc", |
jln | a29d0a3 | 2014-11-26 22:38:35 | [diff] [blame] | 142 | "seccomp-bpf/sandbox_bpf_unittest.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 143 | "seccomp-bpf/syscall_unittest.cc", |
hidehiko | a926d0b | 2015-04-24 21:55:21 | [diff] [blame] | 144 | "seccomp-bpf/trap_unittest.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 145 | ] |
mdempsky | a3fd0ec | 2015-08-26 00:45:52 | [diff] [blame] | 146 | deps += [ ":bpf_dsl_golden" ] |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 147 | } |
| 148 | if (compile_credentials) { |
| 149 | sources += [ |
jln | aedcc3e | 2015-02-12 03:18:10 | [diff] [blame] | 150 | "integration_tests/namespace_unix_domain_socket_unittest.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 151 | "services/credentials_unittest.cc", |
rickyz | 41fb145 | 2015-01-27 03:57:58 | [diff] [blame] | 152 | "services/namespace_utils_unittest.cc", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 153 | ] |
rickyz | 966f039d | 2015-03-17 07:23:43 | [diff] [blame] | 154 | |
jln | 01954fd | 2015-05-15 06:19:33 | [diff] [blame] | 155 | if (use_base_test_suite) { |
| 156 | # Tests that use advanced features not available in stock GTest. |
| 157 | sources += [ "services/namespace_sandbox_unittest.cc" ] |
| 158 | } |
| 159 | |
rickyz | 966f039d | 2015-03-17 07:23:43 | [diff] [blame] | 160 | # For credentials_unittest.cc |
| 161 | configs += [ "//build/config/linux:libcap" ] |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 162 | } |
| 163 | } |
| 164 | |
mdempsky | a3fd0ec | 2015-08-26 00:45:52 | [diff] [blame] | 165 | action("bpf_dsl_golden") { |
| 166 | script = "bpf_dsl/golden/generate.py" |
| 167 | inputs = [ |
| 168 | "bpf_dsl/golden/i386/ArgSizePolicy.txt", |
| 169 | "bpf_dsl/golden/i386/BasicPolicy.txt", |
| 170 | "bpf_dsl/golden/i386/ElseIfPolicy.txt", |
| 171 | "bpf_dsl/golden/i386/MaskingPolicy.txt", |
| 172 | "bpf_dsl/golden/i386/MoreBooleanLogicPolicy.txt", |
| 173 | "bpf_dsl/golden/i386/NegativeConstantsPolicy.txt", |
| 174 | "bpf_dsl/golden/i386/SwitchPolicy.txt", |
| 175 | "bpf_dsl/golden/x86-64/ArgSizePolicy.txt", |
| 176 | "bpf_dsl/golden/x86-64/BasicPolicy.txt", |
| 177 | "bpf_dsl/golden/x86-64/BooleanLogicPolicy.txt", |
| 178 | "bpf_dsl/golden/x86-64/ElseIfPolicy.txt", |
| 179 | "bpf_dsl/golden/x86-64/MaskingPolicy.txt", |
| 180 | "bpf_dsl/golden/x86-64/MoreBooleanLogicPolicy.txt", |
| 181 | "bpf_dsl/golden/x86-64/NegativeConstantsPolicy.txt", |
| 182 | "bpf_dsl/golden/x86-64/SwitchPolicy.txt", |
| 183 | ] |
| 184 | outputs = [ |
| 185 | "$target_gen_dir/bpf_dsl/golden/golden_files.h", |
| 186 | ] |
| 187 | args = |
| 188 | rebase_path(outputs, root_build_dir) + rebase_path(inputs, root_build_dir) |
| 189 | } |
| 190 | |
dpranke | 177c1e2 | 2015-07-22 23:07:43 | [diff] [blame] | 191 | # TODO(GYP): Delete this after we've converted everything to GN. |
| 192 | # The _run targets exist only for compatibility w/ GYP. |
| 193 | group("sandbox_linux_unittests_run") { |
| 194 | testonly = true |
| 195 | deps = [ |
| 196 | ":sandbox_linux_unittests", |
| 197 | ] |
| 198 | } |
| 199 | |
jbudorick | 7d704ad | 2015-10-27 23:30:56 | [diff] [blame] | 200 | # The main sandboxing test target. |
| 201 | test("sandbox_linux_unittests") { |
rockot | 86da06c7f | 2015-02-21 00:40:58 | [diff] [blame] | 202 | deps = [ |
| 203 | ":sandbox_linux_unittests_sources", |
rockot | 86da06c7f | 2015-02-21 00:40:58 | [diff] [blame] | 204 | ] |
| 205 | } |
| 206 | |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 207 | component("seccomp_bpf") { |
| 208 | sources = [ |
[email protected] | fb75e2a | 2014-07-17 07:24:58 | [diff] [blame] | 209 | "bpf_dsl/bpf_dsl.cc", |
| 210 | "bpf_dsl/bpf_dsl.h", |
mdempsky | c60a1c5 | 2014-10-24 23:07:10 | [diff] [blame] | 211 | "bpf_dsl/bpf_dsl_forward.h", |
mdempsky | fb10cce | 2014-10-14 17:56:44 | [diff] [blame] | 212 | "bpf_dsl/bpf_dsl_impl.h", |
mdempsky | b80b1f5 | 2015-02-05 00:54:35 | [diff] [blame] | 213 | "bpf_dsl/codegen.cc", |
| 214 | "bpf_dsl/codegen.h", |
[email protected] | fb75e2a | 2014-07-17 07:24:58 | [diff] [blame] | 215 | "bpf_dsl/cons.h", |
mdempsky | 3909ebf | 2015-08-20 23:18:18 | [diff] [blame] | 216 | "bpf_dsl/errorcode.h", |
jln | a65ffca | 2015-02-13 04:12:43 | [diff] [blame] | 217 | "bpf_dsl/linux_syscall_ranges.h", |
mdempsky | c60a1c5 | 2014-10-24 23:07:10 | [diff] [blame] | 218 | "bpf_dsl/policy.cc", |
| 219 | "bpf_dsl/policy.h", |
mdempsky | 27e78ad7 | 2014-10-16 16:49:54 | [diff] [blame] | 220 | "bpf_dsl/policy_compiler.cc", |
| 221 | "bpf_dsl/policy_compiler.h", |
jln | a65ffca | 2015-02-13 04:12:43 | [diff] [blame] | 222 | "bpf_dsl/seccomp_macros.h", |
mdempsky | ce4c9f1 | 2015-02-05 06:23:05 | [diff] [blame] | 223 | "bpf_dsl/syscall_set.cc", |
| 224 | "bpf_dsl/syscall_set.h", |
mdempsky | 27e78ad7 | 2014-10-16 16:49:54 | [diff] [blame] | 225 | "bpf_dsl/trap_registry.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 226 | "seccomp-bpf/die.cc", |
| 227 | "seccomp-bpf/die.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 228 | "seccomp-bpf/sandbox_bpf.cc", |
| 229 | "seccomp-bpf/sandbox_bpf.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 230 | "seccomp-bpf/syscall.cc", |
| 231 | "seccomp-bpf/syscall.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 232 | "seccomp-bpf/trap.cc", |
| 233 | "seccomp-bpf/trap.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 234 | ] |
| 235 | defines = [ "SANDBOX_IMPLEMENTATION" ] |
| 236 | |
| 237 | deps = [ |
jln | bd4df41c | 2014-11-25 02:32:30 | [diff] [blame] | 238 | ":sandbox_services", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 239 | ":sandbox_services_headers", |
| 240 | "//base", |
| 241 | ] |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 242 | |
| 243 | if (is_nacl_nonsfi) { |
| 244 | cflags = [ "-fgnu-inline-asm" ] |
| 245 | sources -= [ |
| 246 | "bpf_dsl/bpf_dsl_forward.h", |
| 247 | "bpf_dsl/bpf_dsl_impl.h", |
| 248 | "bpf_dsl/cons.h", |
| 249 | "bpf_dsl/errorcode.h", |
| 250 | "bpf_dsl/linux_syscall_ranges.h", |
| 251 | "bpf_dsl/seccomp_macros.h", |
| 252 | "bpf_dsl/trap_registry.h", |
| 253 | ] |
| 254 | } |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | component("seccomp_bpf_helpers") { |
| 258 | sources = [ |
| 259 | "seccomp-bpf-helpers/baseline_policy.cc", |
| 260 | "seccomp-bpf-helpers/baseline_policy.h", |
| 261 | "seccomp-bpf-helpers/sigsys_handlers.cc", |
| 262 | "seccomp-bpf-helpers/sigsys_handlers.h", |
| 263 | "seccomp-bpf-helpers/syscall_parameters_restrictions.cc", |
| 264 | "seccomp-bpf-helpers/syscall_parameters_restrictions.h", |
| 265 | "seccomp-bpf-helpers/syscall_sets.cc", |
| 266 | "seccomp-bpf-helpers/syscall_sets.h", |
| 267 | ] |
| 268 | defines = [ "SANDBOX_IMPLEMENTATION" ] |
| 269 | |
| 270 | deps = [ |
| 271 | "//base", |
jamesr | 4359db7 | 2015-01-21 12:40:00 | [diff] [blame] | 272 | ":sandbox_services", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 273 | ":seccomp_bpf", |
| 274 | ] |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 275 | |
| 276 | if (is_nacl_nonsfi) { |
| 277 | sources -= [ |
| 278 | "seccomp-bpf-helpers/baseline_policy.cc", |
| 279 | "seccomp-bpf-helpers/baseline_policy.h", |
| 280 | "seccomp-bpf-helpers/syscall_sets.cc", |
| 281 | "seccomp-bpf-helpers/syscall_sets.h", |
| 282 | ] |
| 283 | configs += [ ":nacl_nonsfi_warnings" ] |
| 284 | } |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 285 | } |
| 286 | |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 287 | if (is_linux) { |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 288 | # The setuid sandbox for Linux. |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 289 | executable("chrome_sandbox") { |
| 290 | sources = [ |
| 291 | "suid/common/sandbox.h", |
| 292 | "suid/common/suid_unsafe_environment_variables.h", |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 293 | "suid/process_util.h", |
| 294 | "suid/process_util_linux.c", |
| 295 | "suid/sandbox.c", |
| 296 | ] |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 297 | |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 298 | cflags = [ |
| 299 | # For ULLONG_MAX |
| 300 | "-std=gnu99", |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 301 | |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 302 | # These files have a suspicious comparison. |
| 303 | # TODO fix this and re-enable this warning. |
| 304 | "-Wno-sign-compare", |
| 305 | ] |
brettw | ba7a73d | 2015-08-31 22:17:39 | [diff] [blame] | 306 | |
| 307 | deps = [ |
| 308 | "//build/config/sanitizers:deps", |
| 309 | ] |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 310 | } |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | component("sandbox_services") { |
| 314 | sources = [ |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 315 | "services/init_process_reaper.cc", |
| 316 | "services/init_process_reaper.h", |
jln | b14fc80 | 2015-02-12 05:32:11 | [diff] [blame] | 317 | "services/proc_util.cc", |
| 318 | "services/proc_util.h", |
jln | 97718598 | 2015-02-13 20:58:41 | [diff] [blame] | 319 | "services/resource_limits.cc", |
| 320 | "services/resource_limits.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 321 | "services/scoped_process.cc", |
| 322 | "services/scoped_process.h", |
jln | 610a4a61 | 2014-11-20 18:58:21 | [diff] [blame] | 323 | "services/syscall_wrappers.cc", |
| 324 | "services/syscall_wrappers.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 325 | "services/thread_helpers.cc", |
| 326 | "services/thread_helpers.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 327 | "services/yama.cc", |
jln | b14fc80 | 2015-02-12 05:32:11 | [diff] [blame] | 328 | "services/yama.h", |
jln | 878dca3 | 2014-11-11 07:43:57 | [diff] [blame] | 329 | "syscall_broker/broker_channel.cc", |
| 330 | "syscall_broker/broker_channel.h", |
jln | 70c42c20 | 2014-11-01 00:59:57 | [diff] [blame] | 331 | "syscall_broker/broker_client.cc", |
| 332 | "syscall_broker/broker_client.h", |
| 333 | "syscall_broker/broker_common.h", |
leecam | ad78f42 | 2014-11-26 22:08:45 | [diff] [blame] | 334 | "syscall_broker/broker_file_permission.cc", |
| 335 | "syscall_broker/broker_file_permission.h", |
jln | 70c42c20 | 2014-11-01 00:59:57 | [diff] [blame] | 336 | "syscall_broker/broker_host.cc", |
| 337 | "syscall_broker/broker_host.h", |
| 338 | "syscall_broker/broker_policy.cc", |
| 339 | "syscall_broker/broker_policy.h", |
| 340 | "syscall_broker/broker_process.cc", |
| 341 | "syscall_broker/broker_process.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 342 | ] |
| 343 | |
| 344 | defines = [ "SANDBOX_IMPLEMENTATION" ] |
| 345 | |
rickyz | 966f039d | 2015-03-17 07:23:43 | [diff] [blame] | 346 | deps = [ |
| 347 | "//base", |
| 348 | ] |
| 349 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 350 | if (compile_credentials || is_nacl_nonsfi) { |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 351 | sources += [ |
| 352 | "services/credentials.cc", |
| 353 | "services/credentials.h", |
rickyz | 8f235da | 2015-02-03 07:26:19 | [diff] [blame] | 354 | "services/namespace_sandbox.cc", |
| 355 | "services/namespace_sandbox.h", |
rickyz | 41fb145 | 2015-01-27 03:57:58 | [diff] [blame] | 356 | "services/namespace_utils.cc", |
| 357 | "services/namespace_utils.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 358 | ] |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 359 | |
rickyz | 966f039d | 2015-03-17 07:23:43 | [diff] [blame] | 360 | deps += [ ":sandbox_services_headers" ] |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 361 | } |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 362 | |
| 363 | if (is_nacl_nonsfi) { |
| 364 | sources -= [ |
| 365 | "services/init_process_reaper.cc", |
| 366 | "services/init_process_reaper.h", |
| 367 | "services/scoped_process.cc", |
| 368 | "services/scoped_process.h", |
| 369 | "services/yama.cc", |
| 370 | "services/yama.h", |
| 371 | "syscall_broker/broker_channel.cc", |
| 372 | "syscall_broker/broker_channel.h", |
| 373 | "syscall_broker/broker_client.cc", |
| 374 | "syscall_broker/broker_client.h", |
| 375 | "syscall_broker/broker_common.h", |
| 376 | "syscall_broker/broker_file_permission.cc", |
| 377 | "syscall_broker/broker_file_permission.h", |
| 378 | "syscall_broker/broker_host.cc", |
| 379 | "syscall_broker/broker_host.h", |
| 380 | "syscall_broker/broker_policy.cc", |
| 381 | "syscall_broker/broker_policy.h", |
| 382 | "syscall_broker/broker_process.cc", |
| 383 | "syscall_broker/broker_process.h", |
| 384 | ] |
| 385 | } |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | source_set("sandbox_services_headers") { |
| 389 | sources = [ |
jln | aedcc3e | 2015-02-12 03:18:10 | [diff] [blame] | 390 | "system_headers/arm64_linux_syscalls.h", |
hidehiko | a926d0b | 2015-04-24 21:55:21 | [diff] [blame] | 391 | "system_headers/arm64_linux_ucontext.h", |
jln | a65ffca | 2015-02-13 04:12:43 | [diff] [blame] | 392 | "system_headers/arm_linux_syscalls.h", |
hidehiko | a926d0b | 2015-04-24 21:55:21 | [diff] [blame] | 393 | "system_headers/arm_linux_ucontext.h", |
| 394 | "system_headers/i386_linux_ucontext.h", |
dnicoara | 9717805 | 2015-04-15 17:44:04 | [diff] [blame] | 395 | "system_headers/linux_futex.h", |
jln | a65ffca | 2015-02-13 04:12:43 | [diff] [blame] | 396 | "system_headers/linux_seccomp.h", |
hidehiko | a926d0b | 2015-04-24 21:55:21 | [diff] [blame] | 397 | "system_headers/linux_signal.h", |
jln | aedcc3e | 2015-02-12 03:18:10 | [diff] [blame] | 398 | "system_headers/linux_syscalls.h", |
ben | 7598f46 | 2015-05-22 23:19:51 | [diff] [blame] | 399 | "system_headers/linux_time.h", |
hidehiko | a926d0b | 2015-04-24 21:55:21 | [diff] [blame] | 400 | "system_headers/linux_ucontext.h", |
jln | aedcc3e | 2015-02-12 03:18:10 | [diff] [blame] | 401 | "system_headers/x86_32_linux_syscalls.h", |
| 402 | "system_headers/x86_64_linux_syscalls.h", |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 403 | ] |
| 404 | } |
| 405 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 406 | if (compile_suid_client || is_nacl_nonsfi) { |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 407 | component("suid_sandbox_client") { |
| 408 | sources = [ |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 409 | "suid/client/setuid_sandbox_client.cc", |
| 410 | "suid/client/setuid_sandbox_client.h", |
mdempsky | 3cc942a | 2015-02-05 03:29:25 | [diff] [blame] | 411 | "suid/client/setuid_sandbox_host.cc", |
| 412 | "suid/client/setuid_sandbox_host.h", |
scottmg | 7c7296f4 | 2015-02-28 02:23:09 | [diff] [blame] | 413 | "suid/common/sandbox.h", |
| 414 | "suid/common/suid_unsafe_environment_variables.h", |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 415 | ] |
| 416 | defines = [ "SANDBOX_IMPLEMENTATION" ] |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 417 | |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 418 | deps = [ |
| 419 | ":sandbox_services", |
| 420 | "//base", |
| 421 | ] |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 422 | |
| 423 | if (is_nacl_nonsfi) { |
| 424 | sources -= [ |
| 425 | "suid/client/setuid_sandbox_host.cc", |
| 426 | "suid/client/setuid_sandbox_host.h", |
| 427 | "suid/common/sandbox.h", |
| 428 | "suid/common/suid_unsafe_environment_variables.h", |
| 429 | ] |
| 430 | } |
James Robinson | 060f2e3 | 2014-09-10 22:31:37 | [diff] [blame] | 431 | } |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 432 | } |
| 433 | |
| 434 | if (is_android) { |
jbudorick | 7d704ad | 2015-10-27 23:30:56 | [diff] [blame] | 435 | # TODO(GYP) enable this. Needs an android_strip wrapper python script. |
| 436 | #action("sandbox_linux_unittests_stripped") { |
| 437 | # script = "android_stip.py" |
| 438 | # |
| 439 | # in_file = "$root_out_dir/sandbox_linux_unittests" |
| 440 | # |
| 441 | # out_file = "$root_out_dir/sandbox_linux_unittests_stripped" |
| 442 | # outputs = [ out_file ] |
| 443 | # |
| 444 | # args = [ |
| 445 | # rebase_path(in_file, root_build_dir), |
| 446 | # "-o", rebase_path(out_file, root_build_dir), |
| 447 | # ] |
| 448 | # |
| 449 | # deps = [ |
| 450 | # ":sandbox_linux_unittests", |
| 451 | # ] |
| 452 | #} |
[email protected] | 75cd8f0 | 2014-05-29 20:56:02 | [diff] [blame] | 453 | } |