Commit 54da869d authored by Joshua Peraza's avatar Joshua Peraza Committed by Commit Bot

Eliminate 'whitelist' from components/crash/

Change-Id: Ibf442be9a9eb59d0c0558ab97763a4fd589d8826
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343220Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796111}
parent 212f438d
...@@ -121,9 +121,6 @@ ExceptionHandler* g_breakpad = nullptr; ...@@ -121,9 +121,6 @@ ExceptionHandler* g_breakpad = nullptr;
const char* g_asan_report_str = nullptr; const char* g_asan_report_str = nullptr;
#endif #endif
bool g_use_crash_key_white_list = false;
const char* const* g_crash_key_white_list = nullptr;
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#define G_DUMPS_SUPPRESSED_MAGIC 0x5AFECEDE #define G_DUMPS_SUPPRESSED_MAGIC 0x5AFECEDE
uint32_t g_dumps_suppressed = 0; uint32_t g_dumps_suppressed = 0;
...@@ -1137,23 +1134,10 @@ void EnableNonBrowserCrashDumping() { ...@@ -1137,23 +1134,10 @@ void EnableNonBrowserCrashDumping() {
} }
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
bool IsInWhiteList(const base::StringPiece& key) {
DCHECK(g_crash_key_white_list);
for (size_t i = 0; g_crash_key_white_list[i]; ++i) {
if (0 == my_strcmp(g_crash_key_white_list[i], key.data())) {
return true;
}
}
return false;
}
// GetCrashReporterClient() cannot call any Set methods until after // GetCrashReporterClient() cannot call any Set methods until after
// InitCrashKeys(). // InitCrashKeys().
void InitCrashKeys() { void InitCrashKeys() {
crash_reporter::InitializeCrashKeys(); crash_reporter::InitializeCrashKeys();
g_use_crash_key_white_list =
GetCrashReporterClient()->UseCrashKeysWhiteList();
g_crash_key_white_list = GetCrashReporterClient()->GetCrashKeyWhiteList();
} }
void SetCrashLoopBeforeTime(const std::string& process_type, void SetCrashLoopBeforeTime(const std::string& process_type,
...@@ -1870,8 +1854,6 @@ void HandleCrashDump(const BreakpadInfo& info) { ...@@ -1870,8 +1854,6 @@ void HandleCrashDump(const BreakpadInfo& info) {
CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys); CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys);
const CrashKeyStorage::Entry* entry; const CrashKeyStorage::Entry* entry;
while ((entry = crash_key_iterator.Next())) { while ((entry = crash_key_iterator.Next())) {
if (g_use_crash_key_white_list && !IsInWhiteList(entry->key))
continue;
size_t key_size, value_size; size_t key_size, value_size;
// Check for malformed messages. // Check for malformed messages.
key_size = entry->key[CrashKeyStorage::key_size - 1] != '\0' key_size = entry->key[CrashKeyStorage::key_size - 1] != '\0'
......
...@@ -123,14 +123,6 @@ bool CrashReporterClient::GetCrashMetricsLocation(base::FilePath* crash_dir) { ...@@ -123,14 +123,6 @@ bool CrashReporterClient::GetCrashMetricsLocation(base::FilePath* crash_dir) {
return false; return false;
} }
bool CrashReporterClient::UseCrashKeysWhiteList() {
return false;
}
const char* const* CrashReporterClient::GetCrashKeyWhiteList() {
return nullptr;
}
bool CrashReporterClient::IsRunningUnattended() { bool CrashReporterClient::IsRunningUnattended() {
return true; return true;
} }
......
...@@ -130,11 +130,6 @@ class CrashReporterClient { ...@@ -130,11 +130,6 @@ class CrashReporterClient {
virtual bool GetCrashMetricsLocation(base::FilePath* metrics_dir); virtual bool GetCrashMetricsLocation(base::FilePath* metrics_dir);
#endif #endif
virtual bool UseCrashKeysWhiteList();
// Returns a NULL-terminated array of crash keys to whitelist.
virtual const char* const* GetCrashKeyWhiteList();
// Returns true if running in unattended mode (for automated testing). // Returns true if running in unattended mode (for automated testing).
virtual bool IsRunningUnattended(); virtual bool IsRunningUnattended();
...@@ -177,7 +172,7 @@ class CrashReporterClient { ...@@ -177,7 +172,7 @@ class CrashReporterClient {
#if defined(OS_ANDROID) || defined(OS_LINUX) #if defined(OS_ANDROID) || defined(OS_LINUX)
// Configures sanitization of crash dumps. // Configures sanitization of crash dumps.
// |annotations_whitelist| is a nullptr terminated array of NUL-terminated // |allowed_annotations| is a nullptr terminated array of NUL-terminated
// strings of allowed annotation names or nullptr if all annotations are // strings of allowed annotation names or nullptr if all annotations are
// allowed. |target_module| is a pointer to a location inside a module to // allowed. |target_module| is a pointer to a location inside a module to
// target or nullptr if there is no target module. Crash dumps are not // target or nullptr if there is no target module. Crash dumps are not
...@@ -186,7 +181,7 @@ class CrashReporterClient { ...@@ -186,7 +181,7 @@ class CrashReporterClient {
// sanitized for possible PII. If they are sanitized, only small integers and // sanitized for possible PII. If they are sanitized, only small integers and
// pointers to modules and stacks will be preserved. // pointers to modules and stacks will be preserved.
virtual void GetSanitizationInformation( virtual void GetSanitizationInformation(
const char* const** annotations_whitelist, const char* const** allowed_annotations,
void** target_module, void** target_module,
bool* sanitize_stacks); bool* sanitize_stacks);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment