commit | a57c0fc71aad11ce8300548bde45fc9c2117f5f6 | [log] [tgz] |
---|---|---|
author | Joshua Peraza <jperaza@chromium.org> | Thu Dec 03 13:46:45 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Jan 19 07:18:26 2021 -0800 |
tree | f68343dd0f34495846dba439c3e3bcef3a939ebe | |
parent | 23dc5cacd6f0eef40ee6a6c7b500827aefe275e0 [diff] |
linux: Use mmap for attachments in PtraceBroker The broker attempts to use sbrk() to allocate memory to track ptrace attachments. If the process failed due to an OOM, this system call might fail, the broker falls back to saving attachments on the stack, and then overruns the stack. This change updates the broker to use sys_mmap() instead of sbrk(), which is expected to work at least as well. If sys_mmap() fails or the first mapped page is exhausted, further attachments fail without attempting to save them to the stack. Bug: chromium:1128441 Change-Id: I731fcde082ce82adc9028aec3ff65f13608135b0 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2488280 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Joshua Peraza <jperaza@chromium.org> GitOrigin-RevId: 20cbfa49719cb3a295d51f43a55cf03624cb2bf1
Crashpad is a crash-reporting system.
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.