Commit 271bd086 authored by Matthias Liedtke's avatar Matthias Liedtke Committed by V8 LUCI CQ

Revert "[sandbox] Sandboxify ExternalString external pointers"

This reverts commit e7bf8110.

Reason for revert: Failing TSAN runs

Original change's description:
> [sandbox] Sandboxify ExternalString external pointers
>
> Bug: v8:10391
> Change-Id: I0f737e5adf6e4fd24f93436fa5680ff20c1536da
> 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/+/3757901
> Commit-Queue: Samuel Groß <saelo@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82958}

Bug: v8:10391
Change-Id: I384d49016b9494655866339a21dab60d451158a7
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3872271
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: 's avatarSamuel Groß <saelo@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Owners-Override: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82963}
parent f620df20
......@@ -373,8 +373,8 @@ constexpr uint64_t kAllExternalPointerTypeTags[] = {
#define SHARED_EXTERNAL_POINTER_TAGS(V) \
V(kFirstSharedTag, sandboxed, TAG(0)) \
V(kWaiterQueueNodeTag, sandboxed, TAG(0)) \
V(kExternalStringResourceTag, sandboxed, TAG(1)) \
V(kExternalStringResourceDataTag, sandboxed, TAG(2)) \
V(kExternalStringResourceTag, unsandboxed, TAG(1)) \
V(kExternalStringResourceDataTag, unsandboxed, TAG(2)) \
V(kLastSharedTag, sandboxed, TAG(2))
// External pointers using these tags are kept in a per-Isolate external
......
......@@ -595,13 +595,13 @@ void Serializer::ObjectSerializer::SerializeExternalString() {
if (serializer_->external_reference_encoder_.TryEncode(resource).To(
&reference)) {
DCHECK(reference.is_from_api());
#ifdef V8_ENABLE_SANDBOX
#ifdef V8_SANDBOXED_EXTERNAL_POINTERS
uint32_t external_pointer_entry =
string->GetResourceRefForDeserialization();
#endif
string->SetResourceRefForSerialization(reference.index());
SerializeObject();
#ifdef V8_ENABLE_SANDBOX
#ifdef V8_SANDBOXED_EXTERNAL_POINTERS
string->SetResourceRefForSerialization(external_pointer_entry);
#else
string->set_address_as_resource(isolate(), resource);
......
......@@ -349,7 +349,7 @@ class ReadStringVisitor : public TqObjectVisitor {
if (IsExternalStringCached(object)) {
ExternalPointer_t resource_data =
GetOrFinish(object->GetResourceDataValue(accessor_));
#ifdef V8_ENABLE_SANDBOX
#ifdef V8_SANDBOXED_EXTERNAL_POINTERS
Isolate* isolate = GetIsolateForSandbox(
HeapObject::unchecked_cast(Object(heap_addresses_.any_heap_pointer)));
ExternalPointerHandle handle =
......@@ -359,7 +359,7 @@ class ReadStringVisitor : public TqObjectVisitor {
handle, kExternalStringResourceDataTag));
#else
uintptr_t data_address = static_cast<uintptr_t>(resource_data);
#endif // V8_ENABLE_SANDBOX
#endif // V8_COMPRESS_POINTERS
if (done_) return;
ReadStringCharacters<TChar>(object, data_address);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment