Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1123)

Issue 2006943003: [tracing] Sanitize process memory dumps for background mode (Closed)

Created:
4 years, 7 months ago by ssid
Modified:
4 years, 6 months ago
CC:
chromium-reviews, oilpan-reviews, Mads Ager (chromium), wfh+watch_chromium.org, blink-reviews, tracing+reviews_chromium.org, kinuko+watch, kouhei+heap_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@whitelist_mdp
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing] Sanitize process memory dump names for background mode For background mode: 1. ProcessMemoryDump knows the level of detail. 2. It checks for dump name to be present in whitelist. If not then returns a dummy mad. The strings are stripped of numbers (ids) and checked against a whitelist of dump names. 3. Disable creating new dumps just to mark suballocations. 4. Disable creation of global allocator dumps. 5. Disable string attributes in allocator dumps. Also creates a new whitelist file to handle whitelisting logic. BUG=613198 TBR=shess@chromium.org, jochen@chromium.org Committed: https://crrev.com/448e5edbdae14ce8b983726b9d89d248f3d52d23 Cr-Commit-Position: refs/heads/master@{#397918}

Patch Set 1 : #

Total comments: 36

Patch Set 2 : Fixes. #

Total comments: 29

Patch Set 3 : Addressing comments. #

Total comments: 6

Patch Set 4 : Fix stripping. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -74 lines) Patch
M base/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M base/trace_event/java_heap_dump_provider_android_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M base/trace_event/memory_allocator_dump.cc View 1 1 chunk +7 lines, -0 lines 0 comments Download
M base/trace_event/memory_allocator_dump_unittest.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M base/trace_event/memory_dump_manager.h View 1 3 chunks +3 lines, -9 lines 0 comments Download
M base/trace_event/memory_dump_manager.cc View 1 8 chunks +8 lines, -27 lines 0 comments Download
M base/trace_event/memory_dump_manager_unittest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M base/trace_event/memory_dump_provider.h View 1 2 1 chunk +0 lines, -6 lines 0 comments Download
M base/trace_event/memory_dump_request_args.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
A base/trace_event/memory_infra_background_whitelist.h View 1 2 1 chunk +33 lines, -0 lines 0 comments Download
A base/trace_event/memory_infra_background_whitelist.cc View 1 2 3 1 chunk +88 lines, -0 lines 0 comments Download
M base/trace_event/process_memory_dump.h View 1 2 4 chunks +21 lines, -1 line 0 comments Download
M base/trace_event/process_memory_dump.cc View 1 2 3 8 chunks +39 lines, -3 lines 0 comments Download
M base/trace_event/process_memory_dump_unittest.cc View 1 2 3 7 chunks +61 lines, -5 lines 0 comments Download
M base/trace_event/trace_event.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M base/trace_event/winheap_dump_provider_win_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M components/tracing/common/graphics_memory_dump_provider_android_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/tracing/common/process_metrics_memory_dump_provider_unittest.cc View 1 2 4 chunks +8 lines, -5 lines 0 comments Download
M content/common/discardable_shared_memory_heap_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M gin/v8_isolate_memory_dump_provider_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M skia/ext/skia_memory_dump_provider_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M sql/connection_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M sql/sql_memory_dump_provider_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProviderTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/web_process_memory_dump.cc View 1 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 55 (31 generated)
ssid
This isn't fully done (some test files need to be updated outside base). Please give ...
4 years, 7 months ago (2016-05-24 00:46:28 UTC) #3
ssid
+primiano Missed reviewer on last mail. This isn't fully done (some test files need to ...
4 years, 7 months ago (2016-05-24 00:47:39 UTC) #5
Primiano Tucci (use gerrit)
Ok approach makes sense with some comments. 1) General suggestion is: just replace sequence of ...
4 years, 6 months ago (2016-05-27 17:23:35 UTC) #7
ssid
Please see few replies inline. https://codereview.chromium.org/2006943003/diff/60001/base/trace_event/process_memory_dump.cc File base/trace_event/process_memory_dump.cc (right): https://codereview.chromium.org/2006943003/diff/60001/base/trace_event/process_memory_dump.cc#newcode71 base/trace_event/process_memory_dump.cc:71: if (isxdigit(name[i])) { On ...
4 years, 6 months ago (2016-05-27 17:42:48 UTC) #8
Primiano Tucci (use gerrit)
https://codereview.chromium.org/2006943003/diff/60001/base/trace_event/process_memory_dump.cc File base/trace_event/process_memory_dump.cc (right): https://codereview.chromium.org/2006943003/diff/60001/base/trace_event/process_memory_dump.cc#newcode71 base/trace_event/process_memory_dump.cc:71: if (isxdigit(name[i])) { On 2016/05/27 17:42:48, ssid wrote: > ...
4 years, 6 months ago (2016-05-27 17:51:19 UTC) #9
Dmitry Skiba
https://codereview.chromium.org/2006943003/diff/60001/base/trace_event/process_memory_dump.cc File base/trace_event/process_memory_dump.cc (right): https://codereview.chromium.org/2006943003/diff/60001/base/trace_event/process_memory_dump.cc#newcode63 base/trace_event/process_memory_dump.cc:63: // Remove special characters, numbers (including hexadecimal which are ...
4 years, 6 months ago (2016-05-31 06:48:46 UTC) #11
ssid
Sorry for the delay in reply, it was us holiday. replies inline. PTAL Thanks. https://codereview.chromium.org/2006943003/diff/60001/base/trace_event/memory_allocator_dump.cc ...
4 years, 6 months ago (2016-05-31 22:33:20 UTC) #14
ssid
> 2) maybe you could keep a map<string,bool/*is_whitelisted*/> in the session > state so you ...
4 years, 6 months ago (2016-05-31 22:37:37 UTC) #15
Primiano Tucci (use gerrit)
Ok looks great overall, just some final comments. You are right about the set in ...
4 years, 6 months ago (2016-06-02 20:24:05 UTC) #19
ssid
Thanks, made most of the suggested changes. https://codereview.chromium.org/2006943003/diff/180001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (left): https://codereview.chromium.org/2006943003/diff/180001/base/trace_event/memory_dump_manager.cc#oldcode19 base/trace_event/memory_dump_manager.cc:19: #include "base/timer/timer.h" ...
4 years, 6 months ago (2016-06-03 01:59:47 UTC) #20
ssid
+oysteine Please take a look at the whitelisting and safeguards logic. memory_infra_background_whitelist.cc and MemoryAllocatorDump::AddString. These ...
4 years, 6 months ago (2016-06-03 02:15:30 UTC) #27
Primiano Tucci (use gerrit)
LGTM with final change (realized only later sorry). Thanks a lot for the work. Also ...
4 years, 6 months ago (2016-06-03 16:24:37 UTC) #28
ssid
Partially fixed. Thanks https://codereview.chromium.org/2006943003/diff/240001/base/trace_event/memory_infra_background_whitelist.cc File base/trace_event/memory_infra_background_whitelist.cc (right): https://codereview.chromium.org/2006943003/diff/240001/base/trace_event/memory_infra_background_whitelist.cc#newcode64 base/trace_event/memory_infra_background_whitelist.cc:64: } else if (isalpha(name[i])) { On ...
4 years, 6 months ago (2016-06-04 00:26:58 UTC) #29
ssid
+thakis for base/build.gn added two files in base/trace_event. +haraken for tiny changes in Webkit.
4 years, 6 months ago (2016-06-04 00:35:58 UTC) #31
haraken
WebKit LGTM
4 years, 6 months ago (2016-06-04 00:39:23 UTC) #34
Nico
lgtm
4 years, 6 months ago (2016-06-04 01:26:09 UTC) #35
oystein (OOO til 10th of July)
Looks great for a suitably paranoid first approach, thanks! lgtm!
4 years, 6 months ago (2016-06-04 01:50:00 UTC) #36
ssid
On 2016/06/04 01:50:00, Oystein wrote: > Looks great for a suitably paranoid first approach, thanks! ...
4 years, 6 months ago (2016-06-04 08:08:20 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2006943003/280001
4 years, 6 months ago (2016-06-04 08:09:25 UTC) #40
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/171217)
4 years, 6 months ago (2016-06-04 08:17:36 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2006943003/300001
4 years, 6 months ago (2016-06-04 10:33:07 UTC) #47
commit-bot: I haz the power
Committed patchset #7 (id:300001)
4 years, 6 months ago (2016-06-04 12:41:05 UTC) #49
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/448e5edbdae14ce8b983726b9d89d248f3d52d23 Cr-Commit-Position: refs/heads/master@{#397918}
4 years, 6 months ago (2016-06-04 12:42:31 UTC) #51
Scott Hess - ex-Googler
4 years, 6 months ago (2016-06-04 15:16:58 UTC) #52
Message was sent while issue was closed.
sql/ lgtm

Powered by Google App Engine
This is Rietveld 408576698