2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-08-12 23:58:35 +04:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2017-01-11 09:01:03 +03:00
|
|
|
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
|
|
|
|
|
2015-03-10 11:03:12 +03:00
|
|
|
with Files('**'):
|
|
|
|
BUG_COMPONENT = ('Core', 'Security: Process Sandboxing')
|
|
|
|
|
2017-05-13 00:04:42 +03:00
|
|
|
DIRS += ['common']
|
|
|
|
|
2013-10-29 01:54:36 +04:00
|
|
|
if CONFIG['OS_ARCH'] == 'Linux':
|
|
|
|
DIRS += ['linux']
|
2014-08-08 20:55:22 +04:00
|
|
|
elif CONFIG['OS_ARCH'] == 'Darwin':
|
|
|
|
DIRS += ['mac']
|
2013-10-29 01:54:36 +04:00
|
|
|
elif CONFIG['OS_ARCH'] == 'WINNT':
|
2014-09-03 09:10:54 +04:00
|
|
|
Library('sandbox_s')
|
2013-10-31 03:58:45 +04:00
|
|
|
FORCE_STATIC_LIB = True
|
|
|
|
|
2014-02-14 20:07:16 +04:00
|
|
|
DIRS += [
|
2019-03-13 12:24:52 +03:00
|
|
|
'win/src/remotesandboxbroker',
|
2014-02-14 20:07:16 +04:00
|
|
|
'win/src/sandboxbroker',
|
2017-02-15 02:08:40 +03:00
|
|
|
'win/src/sandboxpermissions',
|
2014-02-14 20:07:16 +04:00
|
|
|
'win/src/sandboxtarget',
|
|
|
|
]
|
2013-08-12 23:58:35 +04:00
|
|
|
|
2014-11-29 20:12:18 +03:00
|
|
|
EXPORTS.mozilla.sandboxing += [
|
2015-01-22 11:37:30 +03:00
|
|
|
'chromium-shim/sandbox/win/loggingCallbacks.h',
|
|
|
|
'chromium-shim/sandbox/win/loggingTypes.h',
|
2017-02-15 02:08:40 +03:00
|
|
|
'chromium-shim/sandbox/win/permissionsService.h',
|
2015-01-22 11:37:30 +03:00
|
|
|
'chromium-shim/sandbox/win/sandboxLogging.h',
|
2016-05-15 18:35:22 +03:00
|
|
|
'win/SandboxInitialization.h',
|
2014-11-29 20:12:18 +03:00
|
|
|
]
|
2014-06-11 18:32:37 +04:00
|
|
|
|
2016-05-15 18:23:57 +03:00
|
|
|
SOURCES += [
|
2020-03-06 19:51:54 +03:00
|
|
|
'chromium-shim/base/file_version_info_win.cpp',
|
2016-09-06 10:57:21 +03:00
|
|
|
'chromium-shim/base/files/file_path.cpp',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium-shim/base/logging.cpp',
|
2017-02-15 02:08:40 +03:00
|
|
|
'chromium-shim/sandbox/win/permissionsService.cpp',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium-shim/sandbox/win/sandboxLogging.cpp',
|
|
|
|
'chromium/base/at_exit.cc',
|
|
|
|
'chromium/base/base_switches.cc',
|
|
|
|
'chromium/base/callback_internal.cc',
|
|
|
|
'chromium/base/cpu.cc',
|
|
|
|
'chromium/base/debug/alias.cc',
|
|
|
|
'chromium/base/debug/profiler.cc',
|
2018-01-08 12:07:16 +03:00
|
|
|
'chromium/base/environment.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/hash.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/base/lazy_instance_helpers.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/location.cc',
|
|
|
|
'chromium/base/memory/ref_counted.cc',
|
2017-10-26 17:10:41 +03:00
|
|
|
'chromium/base/memory/shared_memory_handle.cc',
|
2017-03-29 16:23:17 +03:00
|
|
|
'chromium/base/memory/shared_memory_handle_win.cc',
|
|
|
|
'chromium/base/memory/shared_memory_win.cc',
|
|
|
|
'chromium/base/process/process_handle_win.cc',
|
|
|
|
'chromium/base/rand_util_win.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/base/scoped_clear_last_error_win.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/strings/nullable_string16.cc',
|
|
|
|
'chromium/base/strings/string_number_conversions.cc',
|
|
|
|
'chromium/base/strings/string_piece.cc',
|
|
|
|
'chromium/base/strings/string_split.cc',
|
|
|
|
'chromium/base/strings/string_util.cc',
|
|
|
|
'chromium/base/strings/string_util_constants.cc',
|
|
|
|
'chromium/base/strings/stringprintf.cc',
|
|
|
|
'chromium/base/strings/utf_string_conversion_utils.cc',
|
|
|
|
'chromium/base/strings/utf_string_conversions.cc',
|
|
|
|
'chromium/base/synchronization/lock.cc',
|
|
|
|
'chromium/base/synchronization/lock_impl_win.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/base/third_party/dmg_fp/dtoa_wrapper.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/third_party/dmg_fp/g_fmt.cc',
|
|
|
|
'chromium/base/third_party/icu/icu_utf.cc',
|
|
|
|
'chromium/base/third_party/superfasthash/superfasthash.c',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/base/threading/platform_thread.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/threading/platform_thread_win.cc',
|
|
|
|
'chromium/base/threading/thread_collision_warner.cc',
|
|
|
|
'chromium/base/threading/thread_id_name_manager.cc',
|
2017-03-29 16:23:17 +03:00
|
|
|
'chromium/base/threading/thread_local_storage.cc',
|
|
|
|
'chromium/base/threading/thread_local_storage_win.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/threading/thread_restrictions.cc',
|
|
|
|
'chromium/base/time/time.cc',
|
|
|
|
'chromium/base/time/time_win.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/base/token.cc',
|
2017-10-26 17:10:41 +03:00
|
|
|
'chromium/base/unguessable_token.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/base/version.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/win/pe_image.cc',
|
|
|
|
'chromium/base/win/scoped_handle.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/base/win/scoped_handle_verifier.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/base/win/scoped_process_information.cc',
|
|
|
|
'chromium/base/win/startup_information.cc',
|
|
|
|
'chromium/base/win/windows_version.cc',
|
|
|
|
'chromium/sandbox/win/src/acl.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/sandbox/win/src/app_container_profile_base.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/sandbox/win/src/broker_services.cc',
|
|
|
|
'chromium/sandbox/win/src/crosscall_server.cc',
|
|
|
|
'chromium/sandbox/win/src/eat_resolver.cc',
|
|
|
|
'chromium/sandbox/win/src/filesystem_dispatcher.cc',
|
|
|
|
'chromium/sandbox/win/src/filesystem_interception.cc',
|
|
|
|
'chromium/sandbox/win/src/filesystem_policy.cc',
|
|
|
|
'chromium/sandbox/win/src/handle_closer.cc',
|
|
|
|
'chromium/sandbox/win/src/handle_closer_agent.cc',
|
|
|
|
'chromium/sandbox/win/src/handle_dispatcher.cc',
|
|
|
|
'chromium/sandbox/win/src/handle_interception.cc',
|
|
|
|
'chromium/sandbox/win/src/handle_policy.cc',
|
2017-10-26 17:10:41 +03:00
|
|
|
'chromium/sandbox/win/src/heap_helper.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/sandbox/win/src/interception.cc',
|
|
|
|
'chromium/sandbox/win/src/interception_agent.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/sandbox/win/src/ipc_args.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/sandbox/win/src/job.cc',
|
|
|
|
'chromium/sandbox/win/src/named_pipe_dispatcher.cc',
|
|
|
|
'chromium/sandbox/win/src/named_pipe_interception.cc',
|
|
|
|
'chromium/sandbox/win/src/named_pipe_policy.cc',
|
|
|
|
'chromium/sandbox/win/src/policy_broker.cc',
|
|
|
|
'chromium/sandbox/win/src/policy_engine_opcodes.cc',
|
|
|
|
'chromium/sandbox/win/src/policy_engine_processor.cc',
|
|
|
|
'chromium/sandbox/win/src/policy_low_level.cc',
|
|
|
|
'chromium/sandbox/win/src/policy_target.cc',
|
|
|
|
'chromium/sandbox/win/src/process_mitigations.cc',
|
|
|
|
'chromium/sandbox/win/src/process_mitigations_win32k_dispatcher.cc',
|
|
|
|
'chromium/sandbox/win/src/process_mitigations_win32k_interception.cc',
|
|
|
|
'chromium/sandbox/win/src/process_mitigations_win32k_policy.cc',
|
|
|
|
'chromium/sandbox/win/src/process_thread_dispatcher.cc',
|
|
|
|
'chromium/sandbox/win/src/process_thread_interception.cc',
|
|
|
|
'chromium/sandbox/win/src/process_thread_policy.cc',
|
|
|
|
'chromium/sandbox/win/src/registry_dispatcher.cc',
|
|
|
|
'chromium/sandbox/win/src/registry_interception.cc',
|
|
|
|
'chromium/sandbox/win/src/registry_policy.cc',
|
|
|
|
'chromium/sandbox/win/src/resolver.cc',
|
|
|
|
'chromium/sandbox/win/src/restricted_token.cc',
|
|
|
|
'chromium/sandbox/win/src/restricted_token_utils.cc',
|
|
|
|
'chromium/sandbox/win/src/sandbox.cc',
|
|
|
|
'chromium/sandbox/win/src/sandbox_globals.cc',
|
|
|
|
'chromium/sandbox/win/src/sandbox_nt_util.cc',
|
|
|
|
'chromium/sandbox/win/src/sandbox_policy_base.cc',
|
2016-09-06 10:57:21 +03:00
|
|
|
'chromium/sandbox/win/src/sandbox_rand.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/sandbox/win/src/sandbox_utils.cc',
|
2019-06-12 13:10:48 +03:00
|
|
|
'chromium/sandbox/win/src/security_capabilities.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/sandbox/win/src/service_resolver.cc',
|
|
|
|
'chromium/sandbox/win/src/sharedmem_ipc_client.cc',
|
|
|
|
'chromium/sandbox/win/src/sharedmem_ipc_server.cc',
|
|
|
|
'chromium/sandbox/win/src/sid.cc',
|
|
|
|
'chromium/sandbox/win/src/sync_dispatcher.cc',
|
|
|
|
'chromium/sandbox/win/src/sync_interception.cc',
|
|
|
|
'chromium/sandbox/win/src/sync_policy.cc',
|
|
|
|
'chromium/sandbox/win/src/target_interceptions.cc',
|
|
|
|
'chromium/sandbox/win/src/target_process.cc',
|
|
|
|
'chromium/sandbox/win/src/target_services.cc',
|
2016-09-06 10:57:21 +03:00
|
|
|
'chromium/sandbox/win/src/top_level_dispatcher.cc',
|
2016-05-15 18:23:57 +03:00
|
|
|
'chromium/sandbox/win/src/win2k_threadpool.cc',
|
|
|
|
'chromium/sandbox/win/src/win_utils.cc',
|
|
|
|
'chromium/sandbox/win/src/window.cc',
|
2016-05-15 18:35:22 +03:00
|
|
|
'win/SandboxInitialization.cpp',
|
2016-05-15 18:23:57 +03:00
|
|
|
]
|
2019-05-15 16:00:39 +03:00
|
|
|
# Sandbox interceptors can be called before the process's import table
|
|
|
|
# is populated. Don't let the compiler insert any instrumentation that
|
|
|
|
# might call an import.
|
|
|
|
SOURCES['chromium/sandbox/win/src/process_thread_interception.cc'].no_pgo = True
|
2016-05-15 18:23:57 +03:00
|
|
|
|
2018-12-14 16:07:35 +03:00
|
|
|
if CONFIG['CPU_ARCH'] in ('x86_64', 'aarch64'):
|
2016-05-15 18:23:57 +03:00
|
|
|
SOURCES += [
|
|
|
|
'chromium/sandbox/win/src/interceptors_64.cc',
|
|
|
|
'chromium/sandbox/win/src/resolver_64.cc',
|
|
|
|
'chromium/sandbox/win/src/service_resolver_64.cc',
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
SOURCES += [
|
|
|
|
'chromium/sandbox/win/src/resolver_32.cc',
|
|
|
|
'chromium/sandbox/win/src/service_resolver_32.cc',
|
|
|
|
]
|
2014-03-28 08:59:16 +04:00
|
|
|
|
2018-05-11 16:16:13 +03:00
|
|
|
for var in ('UNICODE', '_UNICODE', 'NS_NO_XPCOM',
|
2015-08-03 04:07:09 +03:00
|
|
|
'_CRT_RAND_S', 'CHROMIUM_SANDBOX_BUILD'):
|
2013-11-27 17:55:07 +04:00
|
|
|
DEFINES[var] = True
|
2019-01-21 20:42:03 +03:00
|
|
|
if CONFIG['CC_TYPE'] not in ('gcc', 'clang'):
|
2018-05-11 16:16:13 +03:00
|
|
|
DEFINES['SANDBOX_EXPORTS'] = True
|
2014-02-18 17:49:12 +04:00
|
|
|
|
2015-01-22 11:37:30 +03:00
|
|
|
LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']
|
2014-02-18 17:49:12 +04:00
|
|
|
LOCAL_INCLUDES += ['/security/sandbox/chromium']
|
|
|
|
LOCAL_INCLUDES += ['/nsprpub']
|
2014-03-05 04:39:06 +04:00
|
|
|
|
2017-09-11 21:33:26 +03:00
|
|
|
DisableStlWrapping()
|
2014-08-10 01:25:24 +04:00
|
|
|
|
|
|
|
# Suppress warnings in third-party code.
|
2019-02-15 00:45:27 +03:00
|
|
|
if CONFIG['CC_TYPE'] == 'clang-cl':
|
2014-08-10 01:25:24 +04:00
|
|
|
CXXFLAGS += [
|
2019-03-11 04:39:42 +03:00
|
|
|
'-Wno-deprecated-declarations', # 'GetVersionExW': was declared deprecated
|
2014-08-10 01:25:24 +04:00
|
|
|
]
|