Skip to content

Commit b2eec8b

Browse files
rmacnak-googleCommit Queue
authored and
Commit Queue
committed
[vm, profiler] Also use alignment to detect invalid frame pointers.
TEST=ubsan Change-Id: Ie4742c82c2ca5de5e4283914dd5098bf4c325e5b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375063 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 2c4e65f commit b2eec8b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

runtime/vm/profiler.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ class ProfilerNativeStackWalker : public ProfilerStackWalker {
310310
if (fp == nullptr) {
311311
return false;
312312
}
313+
if (!Utils::IsAligned(fp, kWordSize)) {
314+
return false;
315+
}
313316
uword cursor = reinterpret_cast<uword>(fp);
314317
cursor += sizeof(fp);
315318
bool r = (cursor >= lower_bound_) && (cursor < stack_upper_);

0 commit comments

Comments
 (0)