mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
The load bias is documented to be the difference between the preferred and actual load address for a module, but is declared as an unsigned number, and math using it relies on it being a pointer-precisioned two's complement number that might cause over- or under-flow. ElfImageReader and DebugRendezvous both provide ways to get the load bias for a module and are corroborated in tests. However, the load bias computed by DebugRendezvous does not have access to the preferred address, so there is not enough information to determine the signedness to use with a VMOffset. This patch compares the load biases modulo the numeric range for a pointer to ignore the signedness of the value. Also update the test module to trigger a negative load bias. Bug: chromium:1147922 Change-Id: I55bc49195cfb2def06777e26388380fb9bc0f710 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2569886 Commit-Queue: Joshua Peraza <jperaza@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>