diff options
author | Tobias Sargeant <tobiasjs@google.com> | 2017-01-31 13:42:52 +0000 |
---|---|---|
committer | Tobias Sargeant <tobiasjs@chromium.org> | 2017-01-31 14:13:48 +0000 |
commit | 7c2799f3ba6f8a8186c8883b213c3e59768b1287 (patch) | |
tree | ee80449b56b37400892627baf1414871e2db6948 /src/client/linux/handler/minidump_descriptor.h | |
parent | Fixed a bug where cv record size was not correctly checked. (diff) | |
download | breakpad-7c2799f3ba6f8a8186c8883b213c3e59768b1287.tar.xz |
Sanitize dumped stacks to remove data that may be identifiable.
In order to sanitize the stack contents we erase any pointer-aligned
word that could not be interpreted as a pointer into one of the
processes' memory mappings, or a small integer (+/-4096).
This still retains enough information to unwind stack frames, and also
to recover some register values.
BUG=682278
Change-Id: I541a13b2e92a9d1aea2c06a50bd769a9e25601d3
Reviewed-on: https://chromium-review.googlesource.com/430050
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Diffstat (limited to 'src/client/linux/handler/minidump_descriptor.h')
-rw-r--r-- | src/client/linux/handler/minidump_descriptor.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/client/linux/handler/minidump_descriptor.h b/src/client/linux/handler/minidump_descriptor.h index f601427c..911beaef 100644 --- a/src/client/linux/handler/minidump_descriptor.h +++ b/src/client/linux/handler/minidump_descriptor.h @@ -64,7 +64,8 @@ class MinidumpDescriptor { c_path_(NULL), size_limit_(-1), address_within_principal_mapping_(0), - skip_dump_if_principal_mapping_not_referenced_(false) { + skip_dump_if_principal_mapping_not_referenced_(false), + sanitize_stacks_(false) { assert(!directory.empty()); } @@ -74,7 +75,8 @@ class MinidumpDescriptor { c_path_(NULL), size_limit_(-1), address_within_principal_mapping_(0), - skip_dump_if_principal_mapping_not_referenced_(false) { + skip_dump_if_principal_mapping_not_referenced_(false), + sanitize_stacks_(false) { assert(fd != -1); } @@ -83,7 +85,8 @@ class MinidumpDescriptor { fd_(-1), size_limit_(-1), address_within_principal_mapping_(0), - skip_dump_if_principal_mapping_not_referenced_(false) {} + skip_dump_if_principal_mapping_not_referenced_(false), + sanitize_stacks_(false) {} explicit MinidumpDescriptor(const MinidumpDescriptor& descriptor); MinidumpDescriptor& operator=(const MinidumpDescriptor& descriptor); @@ -126,6 +129,11 @@ class MinidumpDescriptor { skip_dump_if_principal_mapping_not_referenced; } + bool sanitize_stacks() const { return sanitize_stacks_; } + void set_sanitize_stacks(bool sanitize_stacks) { + sanitize_stacks_ = sanitize_stacks; + } + MicrodumpExtraInfo* microdump_extra_info() { assert(IsMicrodumpOnConsole()); return µdump_extra_info_; @@ -167,6 +175,13 @@ class MinidumpDescriptor { // stacks logged. bool skip_dump_if_principal_mapping_not_referenced_; + // If set, stacks are sanitized to remove PII. This involves + // overwriting any pointer-aligned words that are not either + // pointers into a process mapping or small integers (+/-4096). This + // leaves enough information to unwind stacks, and preserve some + // register values, but elides strings and other program data. + bool sanitize_stacks_; + // The extra microdump data (e.g. product name/version, build // fingerprint, gpu fingerprint) that should be appended to the dump // (microdump only). Microdumps don't have the ability of appending |