amd64: reject frames with invalid rsp/rip

CFI might compute invalid rsp/rip values if the values in the callee
frame were corrupted, as in stack overflow. Rejecting the frame
computed by CFI allows Breakpad to fall-back to scanning.

Bug: b/169611285
Change-Id: Ifeb08ab5639932c0e23722a161d9d15403738019
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2456037
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Joshua Peraza 2020-10-07 12:27:28 -07:00
parent f6669d6df4
commit 5c7535af78

View file

@ -143,6 +143,11 @@ StackFrameAMD64* StackwalkerAMD64::GetCallerByCFIFrameInfo(
if ((frame->context_validity & essentials) != essentials)
return NULL;
if (!frame->context.rip || !frame->context.rsp) {
BPLOG(ERROR) << "invalid rip/rsp";
return NULL;
}
frame->trust = StackFrame::FRAME_TRUST_CFI;
return frame.release();
}