[builtins] Fix external-string UAF in StringSubstring on GC transition [v8/v8 : main]

0 views
Skip to first unread message

Jakob Linke (Gerrit)

unread,
Jul 24, 2026, 4:43:53 AM (yesterday) Jul 24
to Victor Gomes, v8-s...@luci-project-accounts.iam.gserviceaccount.com, v8-re...@googlegroups.com
Attention needed from Victor Gomes

Jakob Linke voted Auto-Submit+1

Auto-Submit+1
Open in Gerrit

Related details

Attention is currently required from:
  • Victor Gomes
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Id9be7b36627ad10935b13d110e2db68976e5437c
Gerrit-Change-Number: 8138184
Gerrit-PatchSet: 3
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Jul 2026 08:43:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Olivier Flückiger (Gerrit)

unread,
Jul 24, 2026, 6:14:08 AM (23 hours ago) Jul 24
to Jakob Linke, Victor Gomes, v8-s...@luci-project-accounts.iam.gserviceaccount.com, v8-re...@googlegroups.com
Attention needed from Jakob Linke and Victor Gomes

Olivier Flückiger voted and added 1 comment

Votes added by Olivier Flückiger

Code-Review+1
Commit-Queue+2

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Olivier Flückiger . resolved

lgtm, thanks

Open in Gerrit

Related details

Attention is currently required from:
  • Jakob Linke
  • Victor Gomes
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Id9be7b36627ad10935b13d110e2db68976e5437c
Gerrit-Change-Number: 8138184
Gerrit-PatchSet: 3
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
Gerrit-Attention: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Jul 2026 10:13:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

v8-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
Jul 24, 2026, 6:18:43 AM (23 hours ago) Jul 24
to Jakob Linke, Olivier Flückiger, Victor Gomes, v8-re...@googlegroups.com

v8-s...@luci-project-accounts.iam.gserviceaccount.com submitted the change

Change information

Commit message:
[builtins] Fix external-string UAF in StringSubstring on GC transition

SubString's external path hands AllocAndCopyStringCharacters a raw
pointer into the external resource, then allocates the result; a GC
during that allocation can internalize the source in place. 692245fd4b3
added a post-allocation re-check for sequential sources but skipped
external ones as unable to transition, an assumption dc19ad0e517 then
broke by internalizing one-byte-content external two-byte strings to a
non-external copy, which frees the resource and dangles the pointer.

Reading the freed memory trips the two-byte-to-one-byte CSA_DCHECK on
x64 (a heap-use-after-free on arm, garbage in release). Thread the
tagged source through and bail to the runtime if it is no longer
external after the allocation.
Fixed: 537813778
Change-Id: Id9be7b36627ad10935b13d110e2db68976e5437c
Reviewed-by: Olivier Flückiger <ol...@chromium.org>
Commit-Queue: Olivier Flückiger <ol...@chromium.org>
Auto-Submit: Jakob Linke <jgr...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#108862}
Files:
  • M src/builtins/builtins-string-gen.cc
  • M src/builtins/builtins-string-gen.h
  • M test/mjsunit/mjsunit.status
  • A test/mjsunit/regress/regress-537813778.js
Change size: M
Delta: 4 files changed, 48 insertions(+), 17 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Olivier Flückiger
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Id9be7b36627ad10935b13d110e2db68976e5437c
Gerrit-Change-Number: 8138184
Gerrit-PatchSet: 4
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages