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

Issue 1411603007: [Oilpan] Add use-after-free detector in Member<>

Created:
5 years, 1 month ago by peria
Modified:
5 years ago
CC:
Mads Ager (chromium), darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, kouhei+heap_chromium.org, oilpan-reviews, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add use-after-free detector in Member<> and its subclasses. After this CL, HeapObjectHeader and Member<>s will have a new parameter "gcGeneration". In HeapObjectHeader, gcGeneration means when the object has been allocated, and in Member<>, it means when the pointee object should have been allocated. On ASAN builds, Member<> checks if its gcGeneration is equal to the pointee's gcGeneration on every reference. If they have different values, the reference is a use-after-free, even if the pointee is a live object. Note: currently, this verification is skipped if the assignment happens in a constructor of GCMixin interface class. BUG=550325

Patch Set 1 : #

Total comments: 14

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : Diff from cl/1433843002 #

Patch Set 5 : ConstructGCMixin state #

Patch Set 6 : Move GCMixinTrait with a TODO #

Patch Set 7 : Remove "magic" field used for use-after-free #

Patch Set 8 : Rebase + remove a checkPointer #

Patch Set 9 : Fix test failures #

Total comments: 16

Patch Set 10 : #

Total comments: 4

Patch Set 11 : #

Patch Set 12 : Add NO_SANITIZE_ADDRESS to HeapObjectHeader::gcGeneration #

Patch Set 13 : #

Patch Set 14 : Rebase #

Total comments: 24

Patch Set 15 : #

Patch Set 16 : Replace 0 with named constant #

Patch Set 17 : Avoid using HeapObjectHeader while constructing GCMixin #

Patch Set 18 : Drop HeapObjectHeaderTrait::gcGeneration #

Total comments: 16

Patch Set 19 : Introduce gcGenerationUnchecked #

Total comments: 3

Patch Set 20 : Require full definition of T #

Total comments: 14

Patch Set 21 : Work for comments #

Patch Set 22 : Seek in page #

Patch Set 23 : #

Patch Set 24 : Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -128 lines) Patch
M third_party/WebKit/Source/platform/heap/GarbageCollected.h View 1 2 3 4 4 chunks +7 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/Handle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +68 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/Heap.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +11 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/Heap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +4 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapAllocator.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapPage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 chunks +24 lines, -45 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapPage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 6 chunks +22 lines, -13 lines 1 comment Download
M third_party/WebKit/Source/platform/heap/ThreadState.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +24 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/Visitor.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 76 (26 generated)
peria
PTL, with https://codereview.chromium.org/1414253004/
5 years, 1 month ago (2015-11-10 15:47:22 UTC) #8
haraken
The approach looks good. Would you concatenate this CL with https://codereview.chromium.org/1414253004/? I think putGCGeneration() won't ...
5 years, 1 month ago (2015-11-10 16:37:06 UTC) #9
peria
https://codereview.chromium.org/1411603007/diff/20001/third_party/WebKit/Source/core/css/StylePropertySet.cpp File third_party/WebKit/Source/core/css/StylePropertySet.cpp (right): https://codereview.chromium.org/1411603007/diff/20001/third_party/WebKit/Source/core/css/StylePropertySet.cpp#newcode45 third_party/WebKit/Source/core/css/StylePropertySet.cpp:45: return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(RawPtrWillBeMember<CSSValue>) * count + ...
5 years, 1 month ago (2015-11-11 02:46:35 UTC) #11
haraken
https://codereview.chromium.org/1411603007/diff/20001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/20001/third_party/WebKit/Source/platform/heap/Handle.h#newcode670 third_party/WebKit/Source/platform/heap/Handle.h:670: // for gcGeneration, because the object may not be ...
5 years, 1 month ago (2015-11-11 04:19:29 UTC) #12
peria
https://codereview.chromium.org/1411603007/diff/20001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/20001/third_party/WebKit/Source/platform/heap/Handle.h#newcode670 third_party/WebKit/Source/platform/heap/Handle.h:670: // for gcGeneration, because the object may not be ...
5 years, 1 month ago (2015-11-11 05:51:51 UTC) #14
peria
On 2015/11/10 16:37:06, haraken wrote: > I think putGCGeneration() won't be needed. It is needed ...
5 years, 1 month ago (2015-11-11 06:11:20 UTC) #15
haraken
Getting closer. https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/GarbageCollected.h File third_party/WebKit/Source/platform/heap/GarbageCollected.h (right): https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/GarbageCollected.h#newcode130 third_party/WebKit/Source/platform/heap/GarbageCollected.h:130: virtual bool isHeapObjectAlive() const = 0; In ...
5 years, 1 month ago (2015-11-11 10:03:16 UTC) #16
peria
https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/GarbageCollected.h File third_party/WebKit/Source/platform/heap/GarbageCollected.h (right): https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/GarbageCollected.h#newcode130 third_party/WebKit/Source/platform/heap/GarbageCollected.h:130: virtual bool isHeapObjectAlive() const = 0; On 2015/11/11 10:03:16, ...
5 years, 1 month ago (2015-11-12 14:38:42 UTC) #18
haraken
https://codereview.chromium.org/1411603007/diff/240001/third_party/WebKit/Source/platform/heap/HeapPage.cpp File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/1411603007/diff/240001/third_party/WebKit/Source/platform/heap/HeapPage.cpp#newcode617 third_party/WebKit/Source/platform/heap/HeapPage.cpp:617: HeapObjectHeader* freedHeader = new (NotNull, shrinkAddress) HeapObjectHeader(shrinkSize, header->gcInfoIndex(), Heap::gcGeneration()); ...
5 years, 1 month ago (2015-11-12 15:59:08 UTC) #19
peria
I want your advice again. On ASAN bot, many unit_tests fail with use-after-poison on calling ...
5 years, 1 month ago (2015-11-13 05:44:38 UTC) #20
peria
On 2015/11/13 05:44:38, peria wrote: > I want your advice again. > On ASAN bot, ...
5 years, 1 month ago (2015-11-13 07:01:28 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411603007/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411603007/300001
5 years, 1 month ago (2015-11-13 11:36:47 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/56941)
5 years, 1 month ago (2015-11-13 11:50:24 UTC) #26
haraken
On 2015/11/13 05:44:38, peria wrote: > I want your advice again. > On ASAN bot, ...
5 years, 1 month ago (2015-11-13 12:13:17 UTC) #27
haraken
On 2015/11/13 12:13:17, haraken wrote: > On 2015/11/13 05:44:38, peria wrote: > > I want ...
5 years, 1 month ago (2015-11-13 12:14:17 UTC) #28
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411603007/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411603007/320001
5 years, 1 month ago (2015-11-13 12:33:19 UTC) #30
peria
On 2015/11/13 12:13:17, haraken wrote: > On 2015/11/13 05:44:38, peria wrote: > > I want ...
5 years, 1 month ago (2015-11-13 12:35:03 UTC) #31
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-11-13 13:37:26 UTC) #33
peria
PTL
5 years, 1 month ago (2015-11-16 01:56:05 UTC) #34
haraken
https://codereview.chromium.org/1411603007/diff/340001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/340001/third_party/WebKit/Source/platform/heap/Handle.h#newcode779 third_party/WebKit/Source/platform/heap/Handle.h:779: if (m_raw && m_gcGeneration) { This needs to be ...
5 years, 1 month ago (2015-11-16 02:47:50 UTC) #35
peria
https://codereview.chromium.org/1411603007/diff/340001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/340001/third_party/WebKit/Source/platform/heap/Handle.h#newcode779 third_party/WebKit/Source/platform/heap/Handle.h:779: if (m_raw && m_gcGeneration) { On 2015/11/16 02:47:49, haraken ...
5 years, 1 month ago (2015-11-16 05:33:26 UTC) #37
haraken
https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/Heap.h File third_party/WebKit/Source/platform/heap/Heap.h (right): https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/Heap.h#newcode80 third_party/WebKit/Source/platform/heap/Heap.h:80: { On 2015/11/12 14:38:42, peria wrote: > On 2015/11/11 ...
5 years, 1 month ago (2015-11-16 06:20:30 UTC) #38
denice1302
5 years, 1 month ago (2015-11-16 07:02:10 UTC) #40
peria
https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/Heap.h File third_party/WebKit/Source/platform/heap/Heap.h (right): https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/Heap.h#newcode80 third_party/WebKit/Source/platform/heap/Heap.h:80: { On 2015/11/16 06:20:30, haraken wrote: > On 2015/11/12 ...
5 years, 1 month ago (2015-11-16 07:04:42 UTC) #41
peria
On 2015/11/16 07:04:42, peria wrote: > https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/Heap.h > File third_party/WebKit/Source/platform/heap/Heap.h (right): > > https://codereview.chromium.org/1411603007/diff/200001/third_party/WebKit/Source/platform/heap/Heap.h#newcode80 > ...
5 years, 1 month ago (2015-11-16 07:43:41 UTC) #42
peria
PTL
5 years, 1 month ago (2015-11-16 09:09:24 UTC) #43
haraken
Thanks for being persistent on this! I had to add a couple of additional comments ...
5 years, 1 month ago (2015-11-16 09:38:21 UTC) #44
peria
https://codereview.chromium.org/1411603007/diff/430001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/430001/third_party/WebKit/Source/platform/heap/Handle.h#newcode779 third_party/WebKit/Source/platform/heap/Handle.h:779: if (m_raw && m_gcGeneration && !ThreadState::current()->isConstructingGCMixin()) { On 2015/11/16 ...
5 years, 1 month ago (2015-11-16 12:28:45 UTC) #45
haraken
On 2015/11/16 12:28:45, peria wrote: > https://codereview.chromium.org/1411603007/diff/430001/third_party/WebKit/Source/platform/heap/Handle.h > File third_party/WebKit/Source/platform/heap/Handle.h (right): > > https://codereview.chromium.org/1411603007/diff/430001/third_party/WebKit/Source/platform/heap/Handle.h#newcode779 > ...
5 years, 1 month ago (2015-11-16 12:32:34 UTC) #46
peria
On 2015/11/16 12:32:34, haraken wrote: > https://codereview.chromium.org/1411603007/diff/430001/third_party/WebKit/Source/platform/heap/Heap.h#newcode93 > > third_party/WebKit/Source/platform/heap/Heap.h:93: if > > (!IsFullyDefined<T>::value) > ...
5 years, 1 month ago (2015-11-16 12:53:29 UTC) #47
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411603007/450001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411603007/450001
5 years, 1 month ago (2015-11-16 12:54:23 UTC) #49
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/79253)
5 years, 1 month ago (2015-11-16 14:14:13 UTC) #51
haraken
On 2015/11/16 12:53:29, peria wrote: > On 2015/11/16 12:32:34, haraken wrote: > > > https://codereview.chromium.org/1411603007/diff/430001/third_party/WebKit/Source/platform/heap/Heap.h#newcode93 ...
5 years, 1 month ago (2015-11-16 14:14:55 UTC) #52
peria
Yuta-san, This part needs your help as a template expert. https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h File third_party/WebKit/Source/platform/heap/Heap.h (right): https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h#newcode90 ...
5 years, 1 month ago (2015-11-17 01:36:49 UTC) #54
Yuta Kitamura
https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h File third_party/WebKit/Source/platform/heap/Heap.h (right): https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h#newcode90 third_party/WebKit/Source/platform/heap/Heap.h:90: class HeapObjectHeaderTrait<T, false> { On 2015/11/17 at 01:36:49, peria ...
5 years, 1 month ago (2015-11-17 06:25:13 UTC) #55
haraken
On 2015/11/17 06:25:13, Yuta Kitamura wrote: > https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h > File third_party/WebKit/Source/platform/heap/Heap.h (right): > > https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h#newcode90 ...
5 years, 1 month ago (2015-11-17 07:21:29 UTC) #56
peria
https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h File third_party/WebKit/Source/platform/heap/Heap.h (right): https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h#newcode90 third_party/WebKit/Source/platform/heap/Heap.h:90: class HeapObjectHeaderTrait<T, false> { On 2015/11/17 06:25:12, Yuta Kitamura ...
5 years, 1 month ago (2015-11-17 07:24:57 UTC) #57
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411603007/470001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411603007/470001
5 years, 1 month ago (2015-11-19 15:36:51 UTC) #59
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/81107)
5 years, 1 month ago (2015-11-19 16:44:39 UTC) #62
peria
On 2015/11/17 07:24:57, peria wrote: > https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h > File third_party/WebKit/Source/platform/heap/Heap.h (right): > > https://codereview.chromium.org/1411603007/diff/450001/third_party/WebKit/Source/platform/heap/Heap.h#newcode90 > ...
5 years, 1 month ago (2015-11-20 01:00:29 UTC) #63
haraken
Thanks for the long journey. LGTM. https://codereview.chromium.org/1411603007/diff/470001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/470001/third_party/WebKit/Source/platform/heap/Handle.h#newcode803 third_party/WebKit/Source/platform/heap/Handle.h:803: void checkPointer() In ...
5 years, 1 month ago (2015-11-20 01:59:06 UTC) #64
peria
https://codereview.chromium.org/1411603007/diff/470001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/470001/third_party/WebKit/Source/platform/heap/Handle.h#newcode803 third_party/WebKit/Source/platform/heap/Handle.h:803: void checkPointer() On 2015/11/20 01:59:06, haraken wrote: > > ...
5 years, 1 month ago (2015-11-20 02:27:00 UTC) #65
peria
forgot to reply to a comment. https://codereview.chromium.org/1411603007/diff/470001/third_party/WebKit/Source/platform/heap/Handle.h File third_party/WebKit/Source/platform/heap/Handle.h (right): https://codereview.chromium.org/1411603007/diff/470001/third_party/WebKit/Source/platform/heap/Handle.h#newcode822 third_party/WebKit/Source/platform/heap/Handle.h:822: // of a ...
5 years, 1 month ago (2015-11-20 04:14:50 UTC) #66
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411603007/490001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411603007/490001
5 years, 1 month ago (2015-11-20 04:16:03 UTC) #68
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/81572)
5 years, 1 month ago (2015-11-20 06:09:54 UTC) #70
peria
Update the patch. PS22 was a prototype to try to find HeapObjectHeader without HeapObjectHeaderTrait. A ...
5 years ago (2015-11-25 02:01:58 UTC) #72
haraken
On 2015/11/25 02:01:58, peria wrote: > Update the patch. > PS22 was a prototype to ...
5 years ago (2015-11-25 02:37:04 UTC) #73
haraken
https://codereview.chromium.org/1411603007/diff/570001/third_party/WebKit/Source/platform/heap/HeapPage.cpp File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/1411603007/diff/570001/third_party/WebKit/Source/platform/heap/HeapPage.cpp#newcode1310 third_party/WebKit/Source/platform/heap/HeapPage.cpp:1310: HeapObjectHeader* NormalPage::findHeaderFromObject(const void* obj) I'm afraid that this method ...
5 years ago (2015-11-25 02:38:54 UTC) #74
peria
On 2015/11/25 02:37:04, haraken wrote: > On 2015/11/25 02:01:58, peria wrote: > > Update the ...
5 years ago (2015-11-25 03:18:04 UTC) #75
peria
5 years ago (2015-11-25 03:21:54 UTC) #76
On 2015/11/25 02:38:54, haraken wrote:
>
https://codereview.chromium.org/1411603007/diff/570001/third_party/WebKit/Sou...
> File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right):
> 
>
https://codereview.chromium.org/1411603007/diff/570001/third_party/WebKit/Sou...
> third_party/WebKit/Source/platform/heap/HeapPage.cpp:1310: HeapObjectHeader*
> NormalPage::findHeaderFromObject(const void* obj)
> 
> I'm afraid that this method would be super heavy.
> 
> How much does the cycle time of layout tests increase when you enable the
> use-after-free detection?

Yes, it is so heavy that layout tests becomes 4x slower comparing with tot.
Let me consider how to work for it.

Powered by Google App Engine
This is Rietveld 408576698