Skip to content

Commit 906b190

Browse files
LeszekSwirskiMichal Klocek
authored andcommitted
[backport] CVE-2025-5419
[turbofan] Weaken alias analysis in store-store elimination Bug: 420636529 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6594051 Change-Id: I64525f45a688bc9e7d2335f9c92ca144fc517d12 Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/650558 Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
1 parent cc9ba81 commit 906b190

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

chromium/v8/src/compiler/turboshaft/store-store-elimination-reducer-inl.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,11 @@ class RedundantStoreAnalysis {
324324
// TODO(nicohartmann@): Use the new effect flags to distinguish heap
325325
// access once available.
326326
const bool is_on_heap_store = store.kind.tagged_base;
327-
const bool is_field_store = !store.index().valid();
327+
const bool is_fixed_offset_store = !store.index().valid();
328328
const uint8_t size = store.stored_rep.SizeInBytes();
329-
// For now we consider only stores of fields of objects on the heap.
330-
if (is_on_heap_store && is_field_store) {
329+
// For now we consider only stores of fixed offsets of objects on the
330+
// heap.
331+
if (is_on_heap_store && is_fixed_offset_store) {
331332
bool is_eliminable_store = false;
332333
switch (table_.GetObservability(store.base(), store.offset, size)) {
333334
case StoreObservability::kUnobservable:
@@ -414,11 +415,16 @@ class RedundantStoreAnalysis {
414415
// TODO(nicohartmann@): Use the new effect flags to distinguish heap
415416
// access once available.
416417
const bool is_on_heap_load = load.kind.tagged_base;
417-
const bool is_field_load = !load.index().valid();
418+
const bool is_fixed_offset_load = !load.index().valid();
418419
// For now we consider only loads of fields of objects on the heap.
419-
if (is_on_heap_load && is_field_load) {
420-
table_.MarkPotentiallyAliasingStoresAsObservable(load.base(),
421-
load.offset);
420+
if (is_on_heap_load) {
421+
if (is_fixed_offset_load) {
422+
table_.MarkPotentiallyAliasingStoresAsObservable(load.base(),
423+
load.offset);
424+
} else {
425+
// A dynamically indexed load might alias any fixed offset.
426+
table_.MarkAllStoresAsObservable();
427+
}
422428
}
423429
break;
424430
}

0 commit comments

Comments
 (0)