CVE-2026-106374
Overview
Changed Functions
| Function | Change | Notes |
|---|---|---|
fortest/mjsunit/maglev/regress-552832446.js |
modified |
Files Changed
test/mjsunit/maglev/regress-552832446.jssrc/maglev/maglev-reducer-inl.h
Patch
From bb9d116061464d8778989a71326b36d66a7fb718 Mon Sep 17 00:00:00 2001
From: Marja Hölttä <marja@chromium.org>
Date: Wed, 02 Sep 2026 13:44:13 +0200
Subject: [PATCH] [maglev] Fix bailouts in BuildInlinedAllocation
Don't add all non-escaping uses upfront, since some of the stores might
bail out.
Fixed: 552832446
Change-Id: I18c267a76145e5d1d8e7a0898271e72e5f33e0a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8345768
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109643}
---
diff --git a/src/maglev/maglev-reducer-inl.h b/src/maglev/maglev-reducer-inl.h
index 510da84..efe1746 100644
--- a/src/maglev/maglev-reducer-inl.h
+++ b/src/maglev/maglev-reducer-inl.h
@@ -958,7 +958,6 @@
}
InlinedAllocation* allocation =
ExtendOrReallocateCurrentAllocationBlock(allocation_type, vobject);
- AddNonEscapingUses(allocation, static_cast<int>(values.size()));
StoreTaggedMode store_mode = StoreTaggedMode::kInitializing;
compiler::OptionalScopeInfoRef scope_info;
if (vobject->has_static_map() && vobject->map()->IsContextMap()) {
@@ -982,6 +981,7 @@
}
RETURN_IF_ABORT(BuildInitializeStore(desc, allocation, allocation_type,
value, store_mode, maybe_assigned));
+ AddNonEscapingUses(allocation, 1);
}
if constexpr (ReducerBaseWithLoopEffectTracking<BaseT>) {
if (base_->loop_effects()) {
diff --git a/test/mjsunit/maglev/regress-552832446.js b/test/mjsunit/maglev/regress-552832446.js
new file mode 100644
index 0000000..8cce055
--- /dev/null
+++ b/test/mjsunit/maglev/regress-552832446.js
@@ -0,0 +1,24 @@
+// Copyright 2026 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+function f(obj, ...args) {
+ obj['toString'](...args);
+}
+%PrepareFunctionForOptimization(f);
+
+function g(x) {
+ /1/.test(x);
+ for (let i = 0; i < x.length; ++i) {
+ for (let j = 0; j < 1; j++) {
+ x--;
+ }
+ }
+ f(true, x);
+}
+%PrepareFunctionForOptimization(g);
+g(1);
+%OptimizeMaglevOnNextCall(g);
+g(1);
Regression Test / PoC
diff --git a/test/mjsunit/maglev/regress-552832446.js b/test/mjsunit/maglev/regress-552832446.js
new file mode 100644
index 0000000..8cce055
--- /dev/null
+++ b/test/mjsunit/maglev/regress-552832446.js
@@ -0,0 +1,24 @@
+// Copyright 2026 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+function f(obj, ...args) {
+ obj['toString'](...args);
+}
+%PrepareFunctionForOptimization(f);
+
+function g(x) {
+ /1/.test(x);
+ for (let i = 0; i < x.length; ++i) {
+ for (let j = 0; j < 1; j++) {
+ x--;
+ }
+ }
+ f(true, x);
+}
+%PrepareFunctionForOptimization(g);
+g(1);
+%OptimizeMaglevOnNextCall(g);
+g(1);
Original Bug Report
Debug check failed: use_count_ >= non_escaping_use_count_ (2 vs. 3).
Security Bug
Important: Please do not change the component of this bug manually.
Please READ THIS FAQ before filing a bug: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/security/faq.md
Please see the following link for instructions on filing security bugs: https://www.chromium.org/Home/chromium-security/reporting-security-bugs
Reports may be eligible for reward payments under the Chrome VRP: https://g.co/chrome/vrp
NOTE: Security bugs are normally made public once a fix has been widely deployed.
VULNERABILITY DETAILS
Debug check failed: use_count_ >= non_escaping_use_count_ (2 vs. 3).
VERSION
V8 version 15.4.0 (candidate) Operating System: Linux, not tested on other platforms.
commit b454a68f79b594a84cc524551a6c1042df5cfea1 Date: Wed Aug 26 15:03:22 2026 +0000
Reproduction
Run d8 poc.js
Crash State:
#
# Fatal error in v8/v8/src/maglev/maglev-ir.h, line 6496
# Debug check failed: use_count_ >= non_escaping_use_count_ (2 vs. 3).
#
#
#
#FailureMessage Object: 0x7f1901ff9850
==== C stack trace ===============================
./d8(v8::base::debug::StackTrace::StackTrace()+0x2d) [0x5563619fc74d]
./d8(+0x2a0dfe7) [0x5563619fafe7]
./d8(V8_Fatal(char const*, int, char const*, ...)+0x1e6) [0x5563619ee936]
./d8(+0x2a00fb5) [0x5563619edfb5]
./d8(v8::internal::maglev::InlinedAllocation::HasBeenElided() const+0xc9) [0x55636395e149]
./d8(v8::internal::maglev::AnyUseMarkingProcessor::DropUseOfValueInStoresToCapturedAllocations()+0x8a) [0x556363b5413a]
./d8(v8::internal::maglev::AnyUseMarkingProcessor::PostProcessGraph(v8::internal::maglev::Graph*)+0x19b) [0x556363b5404b]
./d8(v8::internal::maglev::GraphProcessor<v8::internal::maglev::NodeMultiProcessor<v8::internal::maglev::ReturnedValueRepresentationSelector, v8::internal::maglev::AnyUseMarkingProcessor, v8::internal::maglev::RegallocNodeInfoAllocationProcessor>>::ProcessGraph(v8::internal::maglev::Graph*)+0xc77) [0x556363944557]
./d8(v8::internal::maglev::MaglevCompiler::Compile(v8::internal::LocalIsolate*, v8::internal::maglev::MaglevCompilationInfo*)+0x15b5) [0x55636393e965]
./d8(v8::internal::maglev::MaglevCompilationJob::ExecuteJobImpl(v8::internal::RuntimeCallStats*, v8::internal::LocalIsolate*)+0xbb) [0x5563639343fb]
./d8(v8::internal::OptimizedCompilationJob::ExecuteJob(v8::internal::RuntimeCallStats*, v8::internal::LocalIsolate*)+0xe2) [0x556361ce4f42]
./d8(v8::internal::maglev::MaglevConcurrentDispatcher::JobTask::Run(v8::JobDelegate*)+0x1d0) [0x556363937310]
./d8(v8::platform::DefaultJobWorker::Run()+0x191) [0x556361a01431]
./d8(v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run()+0xbf) [0x556361a0e21f]
./d8(+0x2a0b016) [0x5563619f8016]
/lib64/libc.so.6(+0x69277) [0x7f1932e75277]
/lib64/libc.so.6(+0xf083c) [0x7f1932efc83c]
Trace/breakpoint trap (core dumped)