Skip to content

Commit 103203a

Browse files
committed
deps: V8: cherry-pick 1e35f6472510
Original commit message: [LTS-M86][builtins] Harden Array.prototype.concat. Defence in depth patch to prevent JavaScript from executing from within IterateElements. R=​ishell@chromium.org R=​cbruni@chromium.org (cherry picked from commit 8284359ed0607e452a4dda2ce89811fb019b4aaa) No-Try: true No-Presubmit: true No-Tree-Checks: true Bug: chromium:1195977 Change-Id: Ie59d468b73b94818cea986a3ded0804f6dddd10b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2819941 Reviewed-by: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#73898} Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2821961 Commit-Queue: Jana Grill <janagrill@chromium.org> Reviewed-by: Victor-Gabriel Savu <vsavu@google.com> Cr-Commit-Position: refs/branch-heads/8.6@{nodejs#76} Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1} Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472} Refs: v8/v8@1e35f64
1 parent 3e0e10e commit 103203a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.52',
39+
'v8_embedder_string': '-node.53',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Ben Newman <ben@meteor.com>
6767
Ben Noordhuis <info@bnoordhuis.nl>
6868
Benjamin Tan <demoneaux@gmail.com>
6969
Bert Belder <bertbelder@gmail.com>
70+
Brendon Tiszka <btiszka@gmail.com>
7071
Burcu Dogan <burcujdogan@gmail.com>
7172
Caitlin Potter <caitpotter88@gmail.com>
7273
Craig Schlenter <craig.schlenter@gmail.com>

deps/v8/src/builtins/builtins-array.cc

+9
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,9 @@ bool IterateElements(Isolate* isolate, Handle<JSReceiver> receiver,
10801080
case HOLEY_SEALED_ELEMENTS:
10811081
case HOLEY_NONEXTENSIBLE_ELEMENTS:
10821082
case HOLEY_ELEMENTS: {
1083+
// Disallow execution so the cached elements won't change mid execution.
1084+
DisallowJavascriptExecution no_js(isolate);
1085+
10831086
// Run through the elements FixedArray and use HasElement and GetElement
10841087
// to check the prototype for missing elements.
10851088
Handle<FixedArray> elements(FixedArray::cast(array->elements()), isolate);
@@ -1106,6 +1109,9 @@ bool IterateElements(Isolate* isolate, Handle<JSReceiver> receiver,
11061109
}
11071110
case HOLEY_DOUBLE_ELEMENTS:
11081111
case PACKED_DOUBLE_ELEMENTS: {
1112+
// Disallow execution so the cached elements won't change mid execution.
1113+
DisallowJavascriptExecution no_js(isolate);
1114+
11091115
// Empty array is FixedArray but not FixedDoubleArray.
11101116
if (length == 0) break;
11111117
// Run through the elements FixedArray and use HasElement and GetElement
@@ -1142,6 +1148,9 @@ bool IterateElements(Isolate* isolate, Handle<JSReceiver> receiver,
11421148
}
11431149

11441150
case DICTIONARY_ELEMENTS: {
1151+
// Disallow execution so the cached dictionary won't change mid execution.
1152+
DisallowJavascriptExecution no_js(isolate);
1153+
11451154
Handle<NumberDictionary> dict(array->element_dictionary(), isolate);
11461155
std::vector<uint32_t> indices;
11471156
indices.reserve(dict->Capacity() / 2);

0 commit comments

Comments
 (0)