Move heap sandbox related code into a new security/ directory

Bug: v8:10391
Change-Id: Ia123d8034c4ade76c9843df5d947fdc4ee3d8e35
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3226337
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77454}
This commit is contained in:
Samuel Groß 2021-10-19 12:46:29 +02:00 committed by V8 LUCI CQ
parent b141fedfed
commit c6388cd94f
26 changed files with 53 additions and 53 deletions

View File

@ -1088,8 +1088,6 @@ filegroup(
"src/common/assert-scope.cc",
"src/common/assert-scope.h",
"src/common/checks.h",
"src/common/external-pointer-inl.h",
"src/common/external-pointer.h",
"src/common/message-template.h",
"src/common/ptr-compr-inl.h",
"src/common/ptr-compr.h",
@ -1162,8 +1160,6 @@ filegroup(
"src/execution/arguments.h",
"src/execution/execution.cc",
"src/execution/execution.h",
"src/execution/external-pointer-table.cc",
"src/execution/external-pointer-table.h",
"src/execution/frame-constants.h",
"src/execution/frames-inl.h",
"src/execution/frames.cc",
@ -1407,8 +1403,6 @@ filegroup(
"src/init/startup-data-util.h",
"src/init/v8.cc",
"src/init/v8.h",
"src/init/vm-cage.cc",
"src/init/vm-cage.h",
"src/interpreter/block-coverage-builder.h",
"src/interpreter/bytecode-array-builder.cc",
"src/interpreter/bytecode-array-builder.h",
@ -1866,6 +1860,12 @@ filegroup(
"src/base/sanitizer/lsan-page-allocator.h",
"src/base/sanitizer/msan.h",
"src/base/sanitizer/tsan.h",
"src/security/external-pointer-table.cc",
"src/security/external-pointer-table.h",
"src/security/external-pointer-inl.h",
"src/security/external-pointer.h",
"src/security/vm-cage.cc",
"src/security/vm-cage.h",
"src/snapshot/code-serializer.cc",
"src/snapshot/code-serializer.h",
"src/snapshot/context-deserializer.cc",

View File

@ -2703,8 +2703,6 @@ v8_header_set("v8_internal_headers") {
"src/codegen/unoptimized-compilation-info.h",
"src/common/assert-scope.h",
"src/common/checks.h",
"src/common/external-pointer-inl.h",
"src/common/external-pointer.h",
"src/common/message-template.h",
"src/common/ptr-compr-inl.h",
"src/common/ptr-compr.h",
@ -2870,7 +2868,6 @@ v8_header_set("v8_internal_headers") {
"src/execution/arguments-inl.h",
"src/execution/arguments.h",
"src/execution/execution.h",
"src/execution/external-pointer-table.h",
"src/execution/frame-constants.h",
"src/execution/frames-inl.h",
"src/execution/frames.h",
@ -3019,7 +3016,6 @@ v8_header_set("v8_internal_headers") {
"src/init/setup-isolate.h",
"src/init/startup-data-util.h",
"src/init/v8.h",
"src/init/vm-cage.h",
"src/interpreter/block-coverage-builder.h",
"src/interpreter/bytecode-array-builder.h",
"src/interpreter/bytecode-array-iterator.h",
@ -3322,6 +3318,10 @@ v8_header_set("v8_internal_headers") {
"src/roots/roots.h",
"src/runtime/runtime-utils.h",
"src/runtime/runtime.h",
"src/security/external-pointer-inl.h",
"src/security/external-pointer-table.h",
"src/security/external-pointer.h",
"src/security/vm-cage.h",
"src/snapshot/code-serializer.h",
"src/snapshot/context-deserializer.h",
"src/snapshot/context-serializer.h",
@ -4074,7 +4074,6 @@ v8_source_set("v8_base_without_compiler") {
"src/diagnostics/unwinder.cc",
"src/execution/arguments.cc",
"src/execution/execution.cc",
"src/execution/external-pointer-table.cc",
"src/execution/frames.cc",
"src/execution/futex-emulation.cc",
"src/execution/interrupts-scope.cc",
@ -4166,7 +4165,6 @@ v8_source_set("v8_base_without_compiler") {
"src/init/isolate-allocator.cc",
"src/init/startup-data-util.cc",
"src/init/v8.cc",
"src/init/vm-cage.cc",
"src/interpreter/bytecode-array-builder.cc",
"src/interpreter/bytecode-array-iterator.cc",
"src/interpreter/bytecode-array-random-iterator.cc",
@ -4335,6 +4333,8 @@ v8_source_set("v8_base_without_compiler") {
"src/runtime/runtime-typedarray.cc",
"src/runtime/runtime-weak-refs.cc",
"src/runtime/runtime.cc",
"src/security/external-pointer-table.cc",
"src/security/vm-cage.cc",
"src/snapshot/code-serializer.cc",
"src/snapshot/context-deserializer.cc",
"src/snapshot/context-serializer.cc",

View File

@ -40,7 +40,6 @@
#include "src/codegen/cpu-features.h"
#include "src/codegen/script-details.h"
#include "src/common/assert-scope.h"
#include "src/common/external-pointer.h"
#include "src/common/globals.h"
#include "src/compiler-dispatcher/lazy-compile-dispatcher.h"
#include "src/date/date.h"
@ -64,7 +63,6 @@
#include "src/init/icu_util.h"
#include "src/init/startup-data-util.h"
#include "src/init/v8.h"
#include "src/init/vm-cage.h"
#include "src/json/json-parser.h"
#include "src/json/json-stringifier.h"
#include "src/logging/counters-scopes.h"
@ -110,6 +108,8 @@
#include "src/profiler/tick-sample.h"
#include "src/regexp/regexp-utils.h"
#include "src/runtime/runtime.h"
#include "src/security/external-pointer.h"
#include "src/security/vm-cage.h"
#include "src/snapshot/code-serializer.h"
#include "src/snapshot/embedded/embedded-data.h"
#include "src/snapshot/snapshot.h"

View File

@ -9,7 +9,6 @@
#include "src/base/macros.h"
#include "src/codegen/bailout-reason.h"
#include "src/common/external-pointer.h"
#include "src/common/globals.h"
#include "src/common/message-template.h"
#include "src/compiler/code-assembler.h"
@ -27,6 +26,7 @@
#include "src/objects/swiss-name-dictionary.h"
#include "src/objects/tagged-index.h"
#include "src/roots/roots.h"
#include "src/security/external-pointer.h"
#include "torque-generated/exported-macros-assembler.h"
namespace v8 {

View File

@ -18,7 +18,6 @@
#include "src/codegen/string-constants.h"
#include "src/codegen/x64/assembler-x64.h"
#include "src/codegen/x64/register-x64.h"
#include "src/common/external-pointer.h"
#include "src/common/globals.h"
#include "src/debug/debug.h"
#include "src/deoptimizer/deoptimizer.h"
@ -28,6 +27,7 @@
#include "src/logging/counters.h"
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#include "src/security/external-pointer.h"
#include "src/snapshot/snapshot.h"
// Satisfy cpplint check, but don't include platform-specific header. It is

View File

@ -5,7 +5,6 @@
#include "src/compiler/memory-lowering.h"
#include "src/codegen/interface-descriptors-inl.h"
#include "src/common/external-pointer.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/linkage.h"
@ -14,6 +13,7 @@
#include "src/compiler/node.h"
#include "src/compiler/simplified-operator.h"
#include "src/roots/roots-inl.h"
#include "src/security/external-pointer.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/wasm/wasm-linkage.h"

View File

@ -8,10 +8,10 @@
#include "src/builtins/builtins.h"
#include "src/codegen/constants-arch.h"
#include "src/codegen/external-reference-table.h"
#include "src/execution/external-pointer-table.h"
#include "src/execution/stack-guard.h"
#include "src/execution/thread-local-top.h"
#include "src/roots/roots.h"
#include "src/security/external-pointer-table.h"
#include "src/utils/utils.h"
#include "testing/gtest/include/gtest/gtest_prod.h" // nogncheck

View File

@ -24,7 +24,6 @@
#include "src/common/globals.h"
#include "src/debug/interface-types.h"
#include "src/execution/execution.h"
#include "src/execution/external-pointer-table.h"
#include "src/execution/futex-emulation.h"
#include "src/execution/isolate-data.h"
#include "src/execution/messages.h"
@ -35,11 +34,12 @@
#include "src/heap/heap.h"
#include "src/heap/read-only-heap.h"
#include "src/init/isolate-allocator.h"
#include "src/init/vm-cage.h"
#include "src/objects/code.h"
#include "src/objects/contexts.h"
#include "src/objects/debug-objects.h"
#include "src/runtime/runtime.h"
#include "src/security/external-pointer-table.h"
#include "src/security/vm-cage.h"
#include "src/strings/unicode.h"
#include "src/utils/allocation.h"

View File

@ -8,7 +8,7 @@
#include "src/common/ptr-compr.h"
#include "src/execution/isolate.h"
#include "src/heap/code-range.h"
#include "src/init/vm-cage.h"
#include "src/security/vm-cage.h"
#include "src/utils/memcopy.h"
#include "src/utils/utils.h"

View File

@ -20,11 +20,11 @@
#include "src/execution/runtime-profiler.h"
#include "src/execution/simulator.h"
#include "src/init/bootstrapper.h"
#include "src/init/vm-cage.h"
#include "src/libsampler/sampler.h"
#include "src/objects/elements.h"
#include "src/objects/objects-inl.h"
#include "src/profiler/heap-profiler.h"
#include "src/security/vm-cage.h"
#include "src/snapshot/snapshot.h"
#include "src/tracing/tracing-category-observer.h"

View File

@ -9,8 +9,8 @@
#include "src/base/platform/wrappers.h"
#include "src/execution/isolate.h"
#include "src/handles/global-handles.h"
#include "src/init/vm-cage.h"
#include "src/logging/counters.h"
#include "src/security/vm-cage.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/trap-handler/trap-handler.h"

View File

@ -6,11 +6,10 @@
#define V8_OBJECTS_FOREIGN_INL_H_
#include "src/common/globals.h"
#include "src/objects/foreign.h"
#include "src/common/external-pointer-inl.h"
#include "src/heap/heap-write-barrier-inl.h"
#include "src/objects/foreign.h"
#include "src/objects/objects-inl.h"
#include "src/security/external-pointer-inl.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"

View File

@ -5,11 +5,8 @@
#ifndef V8_OBJECTS_JS_ARRAY_BUFFER_INL_H_
#define V8_OBJECTS_JS_ARRAY_BUFFER_INL_H_
#include "src/common/external-pointer.h"
#include "src/objects/js-array-buffer.h"
#include "src/common/external-pointer-inl.h"
#include "src/heap/heap-write-barrier-inl.h"
#include "src/objects/js-array-buffer.h"
#include "src/objects/js-objects-inl.h"
#include "src/objects/objects-inl.h"

View File

@ -16,7 +16,6 @@
#include "src/base/memory.h"
#include "src/base/numbers/double.h"
#include "src/builtins/builtins.h"
#include "src/common/external-pointer-inl.h"
#include "src/common/globals.h"
#include "src/common/ptr-compr-inl.h"
#include "src/handles/handles-inl.h"
@ -43,6 +42,7 @@
#include "src/objects/tagged-impl-inl.h"
#include "src/objects/tagged-index.h"
#include "src/objects/templates.h"
#include "src/security/external-pointer-inl.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"

View File

@ -6,8 +6,6 @@
#define V8_OBJECTS_STRING_INL_H_
#include "src/common/assert-scope.h"
#include "src/common/external-pointer-inl.h"
#include "src/common/external-pointer.h"
#include "src/common/globals.h"
#include "src/execution/isolate-utils.h"
#include "src/handles/handles-inl.h"
@ -17,6 +15,8 @@
#include "src/objects/smi-inl.h"
#include "src/objects/string-table-inl.h"
#include "src/objects/string.h"
#include "src/security/external-pointer-inl.h"
#include "src/security/external-pointer.h"
#include "src/strings/string-hasher-inl.h"
#include "src/utils/utils.h"

4
src/security/OWNERS Normal file
View File

@ -0,0 +1,4 @@
ishell@chromium.org
mlippautz@chromium.org
saelo@chromium.org
verwaest@chromium.org

View File

@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMMON_EXTERNAL_POINTER_INL_H_
#define V8_COMMON_EXTERNAL_POINTER_INL_H_
#ifndef V8_SECURITY_EXTERNAL_POINTER_INL_H_
#define V8_SECURITY_EXTERNAL_POINTER_INL_H_
#include "include/v8-internal.h"
#include "src/common/external-pointer.h"
#include "src/execution/isolate.h"
#include "src/security/external-pointer.h"
namespace v8 {
namespace internal {
@ -105,4 +105,4 @@ V8_INLINE void WriteExternalPointerField(Address field_address,
} // namespace internal
} // namespace v8
#endif // V8_COMMON_EXTERNAL_POINTER_INL_H_
#endif // V8_SECURITY_EXTERNAL_POINTER_INL_H_

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/execution/external-pointer-table.h"
#include "src/security/external-pointer-table.h"
#include "src/base/platform/wrappers.h"

View File

@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_EXECUTION_EXTERNAL_POINTER_TABLE_H_
#define V8_EXECUTION_EXTERNAL_POINTER_TABLE_H_
#ifndef V8_SECURITY_EXTERNAL_POINTER_TABLE_H_
#define V8_SECURITY_EXTERNAL_POINTER_TABLE_H_
#include "src/base/platform/wrappers.h"
#include "src/common/external-pointer.h"
#include "src/security/external-pointer.h"
#include "src/utils/utils.h"
namespace v8 {
@ -71,4 +71,4 @@ class V8_EXPORT_PRIVATE ExternalPointerTable {
} // namespace internal
} // namespace v8
#endif // V8_EXECUTION_EXTERNAL_POINTER_TABLE_H_
#endif // V8_SECURITY_EXTERNAL_POINTER_TABLE_H_

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMMON_EXTERNAL_POINTER_H_
#define V8_COMMON_EXTERNAL_POINTER_H_
#ifndef V8_SECURITY_EXTERNAL_POINTER_H_
#define V8_SECURITY_EXTERNAL_POINTER_H_
#include "src/common/globals.h"
@ -45,4 +45,4 @@ V8_INLINE void WriteExternalPointerField(Address field_address,
} // namespace internal
} // namespace v8
#endif // V8_COMMON_EXTERNAL_POINTER_H_
#endif // V8_SECURITY_EXTERNAL_POINTER_H_

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/init/vm-cage.h"
#include "src/security/vm-cage.h"
#include "include/v8-internal.h"
#include "src/base/bits.h"

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_INIT_VM_CAGE_H_
#define V8_INIT_VM_CAGE_H_
#ifndef V8_SECURITY_VM_CAGE_H_
#define V8_SECURITY_VM_CAGE_H_
#include "include/v8-internal.h"
#include "src/base/bounded-page-allocator.h"
@ -148,4 +148,4 @@ V8_INLINE bool IsValidBackingStorePointer(void* ptr) {
} // namespace internal
} // namespace v8
#endif // V8_INIT_VM_CAGE_H_
#endif // V8_SECURITY_VM_CAGE_H_

View File

@ -8,7 +8,6 @@
#include "src/base/platform/wrappers.h"
#include "src/codegen/assembler-inl.h"
#include "src/common/assert-scope.h"
#include "src/common/external-pointer.h"
#include "src/common/globals.h"
#include "src/execution/isolate.h"
#include "src/heap/heap-inl.h"
@ -33,6 +32,7 @@
#include "src/objects/slots.h"
#include "src/objects/string.h"
#include "src/roots/roots.h"
#include "src/security/external-pointer.h"
#include "src/snapshot/embedded/embedded-data.h"
#include "src/snapshot/references.h"
#include "src/snapshot/serializer-deserializer.h"

View File

@ -17,7 +17,7 @@
#include "src/base/vector.h"
#include "src/flags/flags.h"
#include "src/init/v8.h"
#include "src/init/vm-cage.h"
#include "src/security/vm-cage.h"
#include "src/utils/memcopy.h"
#if V8_LIBC_BIONIC

View File

@ -4,7 +4,7 @@
#include <vector>
#include "src/init/vm-cage.h"
#include "src/security/vm-cage.h"
#include "test/unittests/test-utils.h"
#ifdef V8_VIRTUAL_MEMORY_CAGE_IS_AVAILABLE

View File

@ -7,11 +7,11 @@
#include "debug-helper-internal.h"
#include "heap-constants.h"
#include "include/v8-internal.h"
#include "src/common/external-pointer.h"
#include "src/execution/frame-constants.h"
#include "src/execution/frames.h"
#include "src/execution/isolate-utils.h"
#include "src/objects/string-inl.h"
#include "src/security/external-pointer.h"
#include "src/strings/unicode-inl.h"
#include "torque-generated/class-debug-readers.h"
#include "torque-generated/debug-macros.h"