Skip to content

Commit 7592edd

Browse files
sroettgermibrunin
authored andcommitted
[Backport] CVE-2025-6554: Type Confusion in V8
Cherry-pick of patch originally reviewed on https://chromium-review.googlesource.com/c/v8/v8/+/6682542: don't elide hole checks across optional chain (cherry picked from commit 22e9d9621de58ec6fe6581b56215059a48451b9f) Bug: 427663123 Change-Id: Iefdb15828d807bf9452b88e918a4b46cc2d422fa Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6678591 Commit-Queue: Stephen Röttger <[email protected]> Reviewed-by: Toon Verwaest <[email protected]> Cr-Original-Commit-Position: refs/heads/main@{#101050} Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6682542 Reviewed-by: Leszek Swirski <[email protected]> Reviewed-by: Camillo Bruni <[email protected]> Commit-Queue: Gyuyoung Kim (xWF) <[email protected]> Auto-Submit: Gyuyoung Kim (xWF) <[email protected]> Cr-Commit-Position: refs/branch-heads/13.2@{#100} Cr-Branched-From: 24068c59cedad9ee976ddc05431f5f497b1ebd71-refs/heads/13.2.152@{#1} Cr-Branched-From: 6054ba94db0969220be4f94dc1677fc4696bdc4f-refs/heads/main@{#97085} Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/659335 Reviewed-by: Moss Heim <[email protected]>
1 parent 642f8dc commit 7592edd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

chromium/v8/src/interpreter/bytecode-generator.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,8 @@ class V8_NODISCARD BytecodeGenerator::OptionalChainNullLabelScope final {
12061206
public:
12071207
explicit OptionalChainNullLabelScope(BytecodeGenerator* bytecode_generator)
12081208
: bytecode_generator_(bytecode_generator),
1209-
labels_(bytecode_generator->zone()) {
1209+
labels_(bytecode_generator->zone()),
1210+
hole_check_scope_(bytecode_generator) {
12101211
prev_ = bytecode_generator_->optional_chaining_null_labels_;
12111212
bytecode_generator_->optional_chaining_null_labels_ = &labels_;
12121213
}
@@ -1221,6 +1222,9 @@ class V8_NODISCARD BytecodeGenerator::OptionalChainNullLabelScope final {
12211222
BytecodeGenerator* bytecode_generator_;
12221223
BytecodeLabels labels_;
12231224
BytecodeLabels* prev_;
1225+
// Use the same scope for the entire optional chain, as links earlier in the
1226+
// chain dominate later links, linearly.
1227+
HoleCheckElisionScope hole_check_scope_;
12241228
};
12251229

12261230
// LoopScope delimits the scope of {loop}, from its header to its final jump.
@@ -6338,9 +6342,6 @@ template <typename ExpressionFunc>
63386342
void BytecodeGenerator::BuildOptionalChain(ExpressionFunc expression_func) {
63396343
BytecodeLabel done;
63406344
OptionalChainNullLabelScope label_scope(this);
6341-
// Use the same scope for the entire optional chain, as links earlier in the
6342-
// chain dominate later links, linearly.
6343-
HoleCheckElisionScope elider(this);
63446345
expression_func();
63456346
builder()->Jump(&done);
63466347
label_scope.labels()->Bind(builder());

0 commit comments

Comments
 (0)