Skip to content

Commit de5a1d1

Browse files
trop[bot]zcbenzpatchup[bot]
authored
chore: cherry-pick fix for 1234764 from v8 (#30659)
* chore: cherry-pick fix for 1234764 from v8 (#30587) * chore: cherry-pick fix for 1234764 from v8 * chore: update patches Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> * Update .patches * chore: update patches Co-authored-by: Cheng Zhao <[email protected]> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
1 parent 585eea3 commit de5a1d1

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

patches/v8/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ cherry-pick-fd8cbdf7b888.patch
3535
cherry-pick-fd9ce58ecd13.patch
3636
merged_json_fix_gc_issue_in_buildjsonobject.patch
3737
merged_compiler_fix_a_bug_in.patch
38+
cherry-pick-1234764.patch
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Georg Neis <[email protected]>
3+
Date: Tue, 10 Aug 2021 09:29:33 +0200
4+
Subject: Merged: [compiler] Harden
5+
JSCallReducer::ReduceArrayIteratorPrototypeNext
6+
7+
Revision: 65b20a0e65e1078f5dd230a5203e231bec790ab4
8+
9+
BUG=chromium:1234764
10+
NOTRY=true
11+
NOPRESUBMIT=true
12+
NOTREECHECKS=true
13+
14+
15+
Change-Id: I45faf253695011092de144c8e29bafac5337adec
16+
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3084363
17+
Reviewed-by: Lutz Vahl <[email protected]>
18+
Commit-Queue: Georg Neis <[email protected]>
19+
Cr-Commit-Position: refs/branch-heads/9.2@{#53}
20+
Cr-Branched-From: 51238348f95a1f5e0acc321efac7942d18a687a2-refs/heads/9.2.230@{#1}
21+
Cr-Branched-From: 587a04f02ab0487d194b55a7137dc2045e071597-refs/heads/master@{#74656}
22+
23+
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc
24+
index b77094b7e1f0c57552fc7c8d3cea1f9d9ed7a269..a34b33e3a88b72f3ef6ca665f67cf3e9c7fff173 100644
25+
--- a/src/compiler/js-call-reducer.cc
26+
+++ b/src/compiler/js-call-reducer.cc
27+
@@ -5826,11 +5826,12 @@ Reduction JSCallReducer::ReduceArrayIteratorPrototypeNext(Node* node) {
28+
Node* etrue = effect;
29+
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
30+
{
31+
- // We know that the {index} is range of the {length} now.
32+
+ // This extra check exists to refine the type of {index} but also to break
33+
+ // an exploitation technique that abuses typer mismatches.
34+
index = etrue = graph()->NewNode(
35+
- common()->TypeGuard(
36+
- Type::Range(0.0, length_access.type.Max() - 1.0, graph()->zone())),
37+
- index, etrue, if_true);
38+
+ simplified()->CheckBounds(p.feedback(),
39+
+ CheckBoundsFlag::kAbortOnOutOfBounds),
40+
+ index, length, etrue, if_true);
41+
42+
done_true = jsgraph()->FalseConstant();
43+
if (iteration_kind == IterationKind::kKeys) {

0 commit comments

Comments
 (0)