mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-27 22:54:22 +01:00
Sanity check frame pointer while stackwalking
BUG= Change-Id: Ib9b0fd5ba7f829f8be8cf856ab371c6540279ee5 Reviewed-on: https://chromium-review.googlesource.com/458526 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
parent
124035f4fb
commit
6cfdde4b91
@ -215,6 +215,12 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByFramePointerRecovery(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Sanity check that resulting rbp is still inside stack memory.
|
||||
uint64_t unused;
|
||||
if (!memory_->GetMemoryAtAddress(caller_rbp, &unused)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
StackFrameAMD64* frame = new StackFrameAMD64();
|
||||
frame->trust = StackFrame::FRAME_TRUST_FP;
|
||||
frame->context = last_frame->context;
|
||||
|
@ -690,7 +690,8 @@ TEST_F(GetCallerFrame, CallerPushedRBP) {
|
||||
// frame 1
|
||||
.Mark(&frame1_sp)
|
||||
.Append(32, 0) // body of frame1
|
||||
.Mark(&frame1_rbp); // end of stack
|
||||
.Mark(&frame1_rbp) // end of stack
|
||||
.D64(0);
|
||||
RegionFromSection();
|
||||
|
||||
raw_context.rip = 0x00007400c0000200ULL;
|
||||
|
Loading…
Reference in New Issue
Block a user