blob: 51ded004c22533f6ea2497c8dc527c5a06b3ae87 [file] [log] [blame]
[email protected]75cd8f02014-05-29 20:56:021# 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
5import("//build/config/features.gni")
phosek636bceb32015-10-27 03:36:486import("//build/config/nacl/config.gni")
rsesek7b1273af02016-12-06 20:55:477import("//sandbox/features.gni")
qsrfb5251d12015-01-21 15:57:228import("//testing/test.gni")
[email protected]75cd8f02014-05-29 20:56:029
pkotwiczbbe8d902015-10-29 17:10:0710if (is_android) {
11 import("//build/config/android/rules.gni")
12}
13
[email protected]75cd8f02014-05-29 20:56:0214declare_args() {
15 compile_suid_client = is_linux
16
17 compile_credentials = is_linux
18
jln01954fd2015-05-15 06:19:3319 # On Android, use plain GTest.
20 use_base_test_suite = is_linux
[email protected]75cd8f02014-05-29 20:56:0221}
22
phosek636bceb32015-10-27 03:36:4823if (is_nacl_nonsfi) {
24 config("nacl_nonsfi_warnings") {
25 # There are number of platform specific functions in
26 # seccomp-bpf syscall helpers, which are not being used.
27 cflags = [ "-Wno-unused-function" ]
28 }
29}
30
[email protected]75cd8f02014-05-29 20:56:0231# We have two principal targets: sandbox and sandbox_linux_unittests
32# All other targets are listed as dependencies.
33# There is one notable exception: for historical reasons, chrome_sandbox is
34# the setuid sandbox and is its own target.
35
36group("sandbox") {
brettw00709df2015-12-02 01:40:5037 public_deps = [
[email protected]75cd8f02014-05-29 20:56:0238 ":sandbox_services",
39 ]
phosek636bceb32015-10-27 03:36:4840 if (compile_suid_client || is_nacl_nonsfi) {
brettw00709df2015-12-02 01:40:5041 public_deps += [ ":suid_sandbox_client" ]
[email protected]75cd8f02014-05-29 20:56:0242 }
phosek636bceb32015-10-27 03:36:4843 if (use_seccomp_bpf || is_nacl_nonsfi) {
ejcarusob7865802016-08-30 06:14:3044 public_deps += [ ":seccomp_bpf" ]
[email protected]75cd8f02014-05-29 20:56:0245 }
Robert Sesek5fb31972017-07-12 00:21:4046 if (is_android) {
47 public_deps += [ ":seccomp_starter_android" ]
48 }
[email protected]75cd8f02014-05-29 20:56:0249}
50
51source_set("sandbox_linux_test_utils") {
Brett Wilson0c8745a2014-09-08 22:59:4952 testonly = true
[email protected]75cd8f02014-05-29 20:56:0253 sources = [
54 "tests/sandbox_test_runner.cc",
55 "tests/sandbox_test_runner.h",
56 "tests/sandbox_test_runner_function_pointer.cc",
57 "tests/sandbox_test_runner_function_pointer.h",
[email protected]75cd8f02014-05-29 20:56:0258 "tests/unit_tests.cc",
59 "tests/unit_tests.h",
60 ]
61
62 deps = [
63 "//testing/gtest",
64 ]
65
phosekca8571a92015-12-17 16:35:4266 if (!is_nacl_nonsfi) {
67 sources += [
68 "tests/test_utils.cc",
69 "tests/test_utils.h",
70 ]
71 }
72
73 if (use_seccomp_bpf || is_nacl_nonsfi) {
[email protected]75cd8f02014-05-29 20:56:0274 sources += [
75 "seccomp-bpf/bpf_tester_compatibility_delegate.h",
76 "seccomp-bpf/bpf_tests.h",
77 "seccomp-bpf/sandbox_bpf_test_runner.cc",
78 "seccomp-bpf/sandbox_bpf_test_runner.h",
79 ]
scottmg34fb7e52014-12-03 23:27:2480 deps += [ ":seccomp_bpf" ]
[email protected]75cd8f02014-05-29 20:56:0281 }
jln01954fd2015-05-15 06:19:3382
83 if (use_base_test_suite) {
84 deps += [ "//base/test:test_support" ]
85 defines = [ "SANDBOX_USES_BASE_TEST_SUITE" ]
86 }
[email protected]75cd8f02014-05-29 20:56:0287}
88
pkotwicz41889e32015-10-28 22:17:4889# Sources for sandbox_linux_unittests.
rockot86da06c7f2015-02-21 00:40:5890source_set("sandbox_linux_unittests_sources") {
91 testonly = true
92
[email protected]75cd8f02014-05-29 20:56:0293 sources = [
jlnb14fc802015-02-12 05:32:1194 "services/proc_util_unittest.cc",
jln977185982015-02-13 20:58:4195 "services/resource_limits_unittests.cc",
[email protected]75cd8f02014-05-29 20:56:0296 "services/scoped_process_unittest.cc",
jlnc420f0d2014-11-22 01:12:0997 "services/syscall_wrappers_unittest.cc",
[email protected]75cd8f02014-05-29 20:56:0298 "services/thread_helpers_unittests.cc",
99 "services/yama_unittests.cc",
leecamad78f422014-11-26 22:08:45100 "syscall_broker/broker_file_permission_unittest.cc",
jln70c42c202014-11-01 00:59:57101 "syscall_broker/broker_process_unittest.cc",
[email protected]232f6e112014-06-27 07:51:38102 "tests/main.cc",
103 "tests/scoped_temporary_file.cc",
104 "tests/scoped_temporary_file.h",
105 "tests/scoped_temporary_file_unittest.cc",
jlnc420f0d2014-11-22 01:12:09106 "tests/test_utils_unittest.cc",
[email protected]232f6e112014-06-27 07:51:38107 "tests/unit_tests_unittest.cc",
[email protected]75cd8f02014-05-29 20:56:02108 ]
109
110 deps = [
111 ":sandbox",
112 ":sandbox_linux_test_utils",
113 "//base",
Mostyn Bramley-Moore452bf632017-11-28 21:51:42114 "//base/third_party/dynamic_annotations",
[email protected]75cd8f02014-05-29 20:56:02115 "//testing/gtest",
116 ]
117
jln01954fd2015-05-15 06:19:33118 if (use_base_test_suite) {
119 deps += [ "//base/test:test_support" ]
120 defines = [ "SANDBOX_USES_BASE_TEST_SUITE" ]
121 }
122
[email protected]75cd8f02014-05-29 20:56:02123 if (compile_suid_client) {
mdempsky3cc942a2015-02-05 03:29:25124 sources += [
125 "suid/client/setuid_sandbox_client_unittest.cc",
126 "suid/client/setuid_sandbox_host_unittest.cc",
127 ]
[email protected]75cd8f02014-05-29 20:56:02128 }
129 if (use_seccomp_bpf) {
130 sources += [
[email protected]fb75e2a2014-07-17 07:24:58131 "bpf_dsl/bpf_dsl_unittest.cc",
mdempskyb80b1f52015-02-05 00:54:35132 "bpf_dsl/codegen_unittest.cc",
[email protected]fb75e2a2014-07-17 07:24:58133 "bpf_dsl/cons_unittest.cc",
mdempsky937389d2015-08-31 22:27:23134 "bpf_dsl/dump_bpf.cc",
135 "bpf_dsl/dump_bpf.h",
mdempskyce4c9f12015-02-05 06:23:05136 "bpf_dsl/syscall_set_unittest.cc",
mdempsky3909ebf2015-08-20 23:18:18137 "bpf_dsl/test_trap_registry.cc",
138 "bpf_dsl/test_trap_registry.h",
139 "bpf_dsl/test_trap_registry_unittest.cc",
mdempsky937389d2015-08-31 22:27:23140 "bpf_dsl/verifier.cc",
141 "bpf_dsl/verifier.h",
jlnaedcc3e2015-02-12 03:18:10142 "integration_tests/bpf_dsl_seccomp_unittest.cc",
143 "integration_tests/seccomp_broker_process_unittest.cc",
[email protected]75cd8f02014-05-29 20:56:02144 "seccomp-bpf-helpers/baseline_policy_unittest.cc",
jlnfcdfb102014-09-12 02:47:44145 "seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc",
[email protected]75cd8f02014-05-29 20:56:02146 "seccomp-bpf/bpf_tests_unittest.cc",
jlna29d0a32014-11-26 22:38:35147 "seccomp-bpf/sandbox_bpf_unittest.cc",
[email protected]75cd8f02014-05-29 20:56:02148 "seccomp-bpf/syscall_unittest.cc",
hidehikoa926d0b2015-04-24 21:55:21149 "seccomp-bpf/trap_unittest.cc",
[email protected]75cd8f02014-05-29 20:56:02150 ]
mdempskya3fd0ec2015-08-26 00:45:52151 deps += [ ":bpf_dsl_golden" ]
[email protected]75cd8f02014-05-29 20:56:02152 }
153 if (compile_credentials) {
154 sources += [
jlnaedcc3e2015-02-12 03:18:10155 "integration_tests/namespace_unix_domain_socket_unittest.cc",
[email protected]75cd8f02014-05-29 20:56:02156 "services/credentials_unittest.cc",
rickyz41fb1452015-01-27 03:57:58157 "services/namespace_utils_unittest.cc",
[email protected]75cd8f02014-05-29 20:56:02158 ]
rickyz966f039d2015-03-17 07:23:43159
jln01954fd2015-05-15 06:19:33160 if (use_base_test_suite) {
161 # Tests that use advanced features not available in stock GTest.
162 sources += [ "services/namespace_sandbox_unittest.cc" ]
163 }
164
rickyz966f039d2015-03-17 07:23:43165 # For credentials_unittest.cc
166 configs += [ "//build/config/linux:libcap" ]
[email protected]75cd8f02014-05-29 20:56:02167 }
168}
169
mdempskya3fd0ec2015-08-26 00:45:52170action("bpf_dsl_golden") {
171 script = "bpf_dsl/golden/generate.py"
172 inputs = [
173 "bpf_dsl/golden/i386/ArgSizePolicy.txt",
174 "bpf_dsl/golden/i386/BasicPolicy.txt",
175 "bpf_dsl/golden/i386/ElseIfPolicy.txt",
176 "bpf_dsl/golden/i386/MaskingPolicy.txt",
177 "bpf_dsl/golden/i386/MoreBooleanLogicPolicy.txt",
178 "bpf_dsl/golden/i386/NegativeConstantsPolicy.txt",
179 "bpf_dsl/golden/i386/SwitchPolicy.txt",
180 "bpf_dsl/golden/x86-64/ArgSizePolicy.txt",
181 "bpf_dsl/golden/x86-64/BasicPolicy.txt",
182 "bpf_dsl/golden/x86-64/BooleanLogicPolicy.txt",
183 "bpf_dsl/golden/x86-64/ElseIfPolicy.txt",
184 "bpf_dsl/golden/x86-64/MaskingPolicy.txt",
185 "bpf_dsl/golden/x86-64/MoreBooleanLogicPolicy.txt",
186 "bpf_dsl/golden/x86-64/NegativeConstantsPolicy.txt",
187 "bpf_dsl/golden/x86-64/SwitchPolicy.txt",
188 ]
189 outputs = [
190 "$target_gen_dir/bpf_dsl/golden/golden_files.h",
191 ]
192 args =
193 rebase_path(outputs, root_build_dir) + rebase_path(inputs, root_build_dir)
194}
195
agrieve62ab00282016-04-05 02:03:45196test("sandbox_linux_unittests") {
rockot86da06c7f2015-02-21 00:40:58197 deps = [
198 ":sandbox_linux_unittests_sources",
thomasanderson84fa8b02017-05-18 23:38:47199 "//build/config:exe_and_shlib_deps",
rockot86da06c7f2015-02-21 00:40:58200 ]
agrieve62ab00282016-04-05 02:03:45201 if (is_android) {
202 use_raw_android_executable = true
203 }
rockot86da06c7f2015-02-21 00:40:58204}
205
[email protected]75cd8f02014-05-29 20:56:02206component("seccomp_bpf") {
207 sources = [
[email protected]fb75e2a2014-07-17 07:24:58208 "bpf_dsl/bpf_dsl.cc",
209 "bpf_dsl/bpf_dsl.h",
mdempskyc60a1c52014-10-24 23:07:10210 "bpf_dsl/bpf_dsl_forward.h",
mdempskyfb10cce2014-10-14 17:56:44211 "bpf_dsl/bpf_dsl_impl.h",
mdempskyb80b1f52015-02-05 00:54:35212 "bpf_dsl/codegen.cc",
213 "bpf_dsl/codegen.h",
[email protected]fb75e2a2014-07-17 07:24:58214 "bpf_dsl/cons.h",
mdempsky3909ebf2015-08-20 23:18:18215 "bpf_dsl/errorcode.h",
jlna65ffca2015-02-13 04:12:43216 "bpf_dsl/linux_syscall_ranges.h",
mdempskyc60a1c52014-10-24 23:07:10217 "bpf_dsl/policy.cc",
218 "bpf_dsl/policy.h",
mdempsky27e78ad72014-10-16 16:49:54219 "bpf_dsl/policy_compiler.cc",
220 "bpf_dsl/policy_compiler.h",
jlna65ffca2015-02-13 04:12:43221 "bpf_dsl/seccomp_macros.h",
mdempskyce4c9f12015-02-05 06:23:05222 "bpf_dsl/syscall_set.cc",
223 "bpf_dsl/syscall_set.h",
mdempsky27e78ad72014-10-16 16:49:54224 "bpf_dsl/trap_registry.h",
ejcarusob7865802016-08-30 06:14:30225 "seccomp-bpf-helpers/baseline_policy.cc",
226 "seccomp-bpf-helpers/baseline_policy.h",
Robert Sesekf2255a22017-07-07 16:02:39227 "seccomp-bpf-helpers/baseline_policy_android.cc",
228 "seccomp-bpf-helpers/baseline_policy_android.h",
ejcarusob7865802016-08-30 06:14:30229 "seccomp-bpf-helpers/sigsys_handlers.cc",
230 "seccomp-bpf-helpers/sigsys_handlers.h",
231 "seccomp-bpf-helpers/syscall_parameters_restrictions.cc",
232 "seccomp-bpf-helpers/syscall_parameters_restrictions.h",
233 "seccomp-bpf-helpers/syscall_sets.cc",
234 "seccomp-bpf-helpers/syscall_sets.h",
[email protected]75cd8f02014-05-29 20:56:02235 "seccomp-bpf/die.cc",
236 "seccomp-bpf/die.h",
[email protected]75cd8f02014-05-29 20:56:02237 "seccomp-bpf/sandbox_bpf.cc",
238 "seccomp-bpf/sandbox_bpf.h",
[email protected]75cd8f02014-05-29 20:56:02239 "seccomp-bpf/syscall.cc",
240 "seccomp-bpf/syscall.h",
[email protected]75cd8f02014-05-29 20:56:02241 "seccomp-bpf/trap.cc",
242 "seccomp-bpf/trap.h",
[email protected]75cd8f02014-05-29 20:56:02243 ]
244 defines = [ "SANDBOX_IMPLEMENTATION" ]
245
brettw63340882016-03-22 17:09:49246 public_deps = [
247 ":sandbox_services_headers",
Thiago Farina10ec8a62017-05-15 20:38:09248 "//sandbox:sandbox_export",
brettw63340882016-03-22 17:09:49249 ]
[email protected]75cd8f02014-05-29 20:56:02250 deps = [
jlnbd4df41c2014-11-25 02:32:30251 ":sandbox_services",
[email protected]75cd8f02014-05-29 20:56:02252 "//base",
Mostyn Bramley-Moore452bf632017-11-28 21:51:42253 "//base/third_party/dynamic_annotations",
[email protected]75cd8f02014-05-29 20:56:02254 ]
phosek636bceb32015-10-27 03:36:48255
256 if (is_nacl_nonsfi) {
257 cflags = [ "-fgnu-inline-asm" ]
258 sources -= [
259 "bpf_dsl/bpf_dsl_forward.h",
260 "bpf_dsl/bpf_dsl_impl.h",
261 "bpf_dsl/cons.h",
262 "bpf_dsl/errorcode.h",
263 "bpf_dsl/linux_syscall_ranges.h",
264 "bpf_dsl/seccomp_macros.h",
265 "bpf_dsl/trap_registry.h",
phosek636bceb32015-10-27 03:36:48266 "seccomp-bpf-helpers/baseline_policy.cc",
267 "seccomp-bpf-helpers/baseline_policy.h",
268 "seccomp-bpf-helpers/syscall_sets.cc",
269 "seccomp-bpf-helpers/syscall_sets.h",
270 ]
271 configs += [ ":nacl_nonsfi_warnings" ]
272 }
[email protected]75cd8f02014-05-29 20:56:02273}
274
Robert Sesek5fb31972017-07-12 00:21:40275if (is_android) {
276 # This target is available even if use_seccomp_bpf is disabled, but it also
277 # works when it is enabled.
278 component("seccomp_starter_android") {
279 sources = [
280 "seccomp-bpf-helpers/seccomp_starter_android.cc",
281 "seccomp-bpf-helpers/seccomp_starter_android.h",
282 ]
283
284 defines = [ "SANDBOX_IMPLEMENTATION" ]
285
286 deps = [
287 "//base",
Robert Sesekd4b1c132017-07-13 21:22:05288 "//sandbox:sandbox_features",
Robert Sesek5fb31972017-07-12 00:21:40289 ]
290
291 if (use_seccomp_bpf) {
292 deps += [ ":seccomp_bpf" ]
293 }
294
295 visibility = [ ":*" ]
296 }
297}
298
James Robinson060f2e32014-09-10 22:31:37299if (is_linux) {
scottmg34fb7e52014-12-03 23:27:24300 # The setuid sandbox for Linux.
James Robinson060f2e32014-09-10 22:31:37301 executable("chrome_sandbox") {
302 sources = [
303 "suid/common/sandbox.h",
304 "suid/common/suid_unsafe_environment_variables.h",
James Robinson060f2e32014-09-10 22:31:37305 "suid/process_util.h",
306 "suid/process_util_linux.c",
307 "suid/sandbox.c",
308 ]
[email protected]75cd8f02014-05-29 20:56:02309
James Robinson060f2e32014-09-10 22:31:37310 cflags = [
311 # For ULLONG_MAX
312 "-std=gnu99",
scottmg34fb7e52014-12-03 23:27:24313
James Robinson060f2e32014-09-10 22:31:37314 # These files have a suspicious comparison.
315 # TODO fix this and re-enable this warning.
316 "-Wno-sign-compare",
317 ]
brettwba7a73d2015-08-31 22:17:39318
dpranke3ea22b3a2016-06-09 23:39:50319 import("//build/config/compiler/compiler.gni")
320 import("//build/config/sanitizers/sanitizers.gni")
dpranke651705f2016-07-15 03:58:47321 if (is_component_build || using_sanitizer) {
dpranke3ea22b3a2016-06-09 23:39:50322 # WARNING! We remove this config so that we don't accidentally
323 # pick up the //build/config:rpath_for_built_shared_libraries
324 # sub-config. However, this means that we need to duplicate any
325 # other flags that executable_config might have.
326 configs -= [ "//build/config:executable_config" ]
327 if (!use_gold) {
dpranke41d05be2016-06-13 18:59:31328 ldflags = [ "-Wl,--disable-new-dtags" ]
dpranke3ea22b3a2016-06-09 23:39:50329 }
330 }
331
dpranke651705f2016-07-15 03:58:47332 # We also do not want to pick up any of the other sanitizer
333 # flags (i.e. we do not want to build w/ the sanitizers at all).
334 # This is safe to delete unconditionally, because it is part of the
335 # default configs and empty when not using the sanitizers.
336 configs -= [ "//build/config/sanitizers:default_sanitizer_flags" ]
James Robinson060f2e32014-09-10 22:31:37337 }
[email protected]75cd8f02014-05-29 20:56:02338}
339
340component("sandbox_services") {
341 sources = [
[email protected]75cd8f02014-05-29 20:56:02342 "services/init_process_reaper.cc",
343 "services/init_process_reaper.h",
jlnb14fc802015-02-12 05:32:11344 "services/proc_util.cc",
345 "services/proc_util.h",
jln977185982015-02-13 20:58:41346 "services/resource_limits.cc",
347 "services/resource_limits.h",
[email protected]75cd8f02014-05-29 20:56:02348 "services/scoped_process.cc",
349 "services/scoped_process.h",
jln610a4a612014-11-20 18:58:21350 "services/syscall_wrappers.cc",
351 "services/syscall_wrappers.h",
[email protected]75cd8f02014-05-29 20:56:02352 "services/thread_helpers.cc",
353 "services/thread_helpers.h",
[email protected]75cd8f02014-05-29 20:56:02354 "services/yama.cc",
jlnb14fc802015-02-12 05:32:11355 "services/yama.h",
jln878dca32014-11-11 07:43:57356 "syscall_broker/broker_channel.cc",
357 "syscall_broker/broker_channel.h",
jln70c42c202014-11-01 00:59:57358 "syscall_broker/broker_client.cc",
359 "syscall_broker/broker_client.h",
Tom Sepeza788b142017-12-05 01:17:08360 "syscall_broker/broker_command.cc",
361 "syscall_broker/broker_command.h",
leecamad78f422014-11-26 22:08:45362 "syscall_broker/broker_file_permission.cc",
363 "syscall_broker/broker_file_permission.h",
jln70c42c202014-11-01 00:59:57364 "syscall_broker/broker_host.cc",
365 "syscall_broker/broker_host.h",
Tom Sepez18f57542017-12-07 22:46:30366 "syscall_broker/broker_permission_list.cc",
367 "syscall_broker/broker_permission_list.h",
jln70c42c202014-11-01 00:59:57368 "syscall_broker/broker_process.cc",
369 "syscall_broker/broker_process.h",
[email protected]75cd8f02014-05-29 20:56:02370 ]
371
372 defines = [ "SANDBOX_IMPLEMENTATION" ]
373
Thiago Farina10ec8a62017-05-15 20:38:09374 public_deps = [
375 "//sandbox:sandbox_export",
376 ]
rickyz966f039d2015-03-17 07:23:43377 deps = [
378 "//base",
Mostyn Bramley-Moore452bf632017-11-28 21:51:42379 "//base/third_party/dynamic_annotations",
rickyz966f039d2015-03-17 07:23:43380 ]
381
phosek636bceb32015-10-27 03:36:48382 if (compile_credentials || is_nacl_nonsfi) {
[email protected]75cd8f02014-05-29 20:56:02383 sources += [
384 "services/credentials.cc",
385 "services/credentials.h",
rickyz8f235da2015-02-03 07:26:19386 "services/namespace_sandbox.cc",
387 "services/namespace_sandbox.h",
rickyz41fb1452015-01-27 03:57:58388 "services/namespace_utils.cc",
389 "services/namespace_utils.h",
[email protected]75cd8f02014-05-29 20:56:02390 ]
scottmg34fb7e52014-12-03 23:27:24391
brettw63340882016-03-22 17:09:49392 public_deps += [ ":sandbox_services_headers" ]
[email protected]75cd8f02014-05-29 20:56:02393 }
phosek636bceb32015-10-27 03:36:48394
395 if (is_nacl_nonsfi) {
mcgrathr87cb1c072015-11-20 21:47:40396 cflags = [ "-fgnu-inline-asm" ]
397
phosek636bceb32015-10-27 03:36:48398 sources -= [
399 "services/init_process_reaper.cc",
400 "services/init_process_reaper.h",
401 "services/scoped_process.cc",
402 "services/scoped_process.h",
403 "services/yama.cc",
404 "services/yama.h",
405 "syscall_broker/broker_channel.cc",
406 "syscall_broker/broker_channel.h",
407 "syscall_broker/broker_client.cc",
408 "syscall_broker/broker_client.h",
Tom Sepeza788b142017-12-05 01:17:08409 "syscall_broker/broker_command.cc",
410 "syscall_broker/broker_command.h",
phosek636bceb32015-10-27 03:36:48411 "syscall_broker/broker_file_permission.cc",
412 "syscall_broker/broker_file_permission.h",
413 "syscall_broker/broker_host.cc",
414 "syscall_broker/broker_host.h",
Tom Sepez18f57542017-12-07 22:46:30415 "syscall_broker/broker_permission_list.cc",
416 "syscall_broker/broker_permission_list.h",
phosek636bceb32015-10-27 03:36:48417 "syscall_broker/broker_process.cc",
418 "syscall_broker/broker_process.h",
419 ]
Tom Sepezb081ec32018-01-25 03:18:22420 } else if (!is_android) {
421 sources += [
422 "services/libc_interceptor.cc",
423 "services/libc_interceptor.h",
424 ]
phosek636bceb32015-10-27 03:36:48425 }
[email protected]75cd8f02014-05-29 20:56:02426}
427
428source_set("sandbox_services_headers") {
429 sources = [
jlnaedcc3e2015-02-12 03:18:10430 "system_headers/arm64_linux_syscalls.h",
hidehikoa926d0b2015-04-24 21:55:21431 "system_headers/arm64_linux_ucontext.h",
jlna65ffca2015-02-13 04:12:43432 "system_headers/arm_linux_syscalls.h",
hidehikoa926d0b2015-04-24 21:55:21433 "system_headers/arm_linux_ucontext.h",
434 "system_headers/i386_linux_ucontext.h",
tfarina1d7984c2017-03-27 23:00:22435 "system_headers/linux_filter.h",
dnicoara97178052015-04-15 17:44:04436 "system_headers/linux_futex.h",
jlna65ffca2015-02-13 04:12:43437 "system_headers/linux_seccomp.h",
hidehikoa926d0b2015-04-24 21:55:21438 "system_headers/linux_signal.h",
jlnaedcc3e2015-02-12 03:18:10439 "system_headers/linux_syscalls.h",
ben7598f462015-05-22 23:19:51440 "system_headers/linux_time.h",
hidehikoa926d0b2015-04-24 21:55:21441 "system_headers/linux_ucontext.h",
tfarina1d7984c2017-03-27 23:00:22442 "system_headers/mips64_linux_syscalls.h",
Wang Qing534d7ce2017-09-18 23:35:59443 "system_headers/mips64_linux_ucontext.h",
tfarina1d7984c2017-03-27 23:00:22444 "system_headers/mips_linux_syscalls.h",
445 "system_headers/mips_linux_ucontext.h",
jlnaedcc3e2015-02-12 03:18:10446 "system_headers/x86_32_linux_syscalls.h",
447 "system_headers/x86_64_linux_syscalls.h",
tfarina1d7984c2017-03-27 23:00:22448 "system_headers/x86_64_linux_ucontext.h",
[email protected]75cd8f02014-05-29 20:56:02449 ]
450}
451
phosek636bceb32015-10-27 03:36:48452if (compile_suid_client || is_nacl_nonsfi) {
James Robinson060f2e32014-09-10 22:31:37453 component("suid_sandbox_client") {
454 sources = [
James Robinson060f2e32014-09-10 22:31:37455 "suid/client/setuid_sandbox_client.cc",
456 "suid/client/setuid_sandbox_client.h",
mdempsky3cc942a2015-02-05 03:29:25457 "suid/client/setuid_sandbox_host.cc",
458 "suid/client/setuid_sandbox_host.h",
scottmg7c7296f42015-02-28 02:23:09459 "suid/common/sandbox.h",
460 "suid/common/suid_unsafe_environment_variables.h",
James Robinson060f2e32014-09-10 22:31:37461 ]
462 defines = [ "SANDBOX_IMPLEMENTATION" ]
Thiago Farina10ec8a62017-05-15 20:38:09463 public_deps = [
464 "//sandbox:sandbox_export",
465 ]
James Robinson060f2e32014-09-10 22:31:37466 deps = [
467 ":sandbox_services",
468 "//base",
Mostyn Bramley-Moore452bf632017-11-28 21:51:42469 "//base/third_party/dynamic_annotations",
James Robinson060f2e32014-09-10 22:31:37470 ]
phosek636bceb32015-10-27 03:36:48471
472 if (is_nacl_nonsfi) {
473 sources -= [
474 "suid/client/setuid_sandbox_host.cc",
475 "suid/client/setuid_sandbox_host.h",
476 "suid/common/sandbox.h",
477 "suid/common/suid_unsafe_environment_variables.h",
478 ]
479 }
James Robinson060f2e32014-09-10 22:31:37480 }
[email protected]75cd8f02014-05-29 20:56:02481}