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

Issue 556443003: Oilpan: Fix ASan instrumentation around heap object headers. (Closed)

Created:
6 years, 3 months ago by Mads Ager (chromium)
Modified:
6 years, 3 months ago
CC:
blink-reviews, abarth-chromium, haraken, blink-reviews-wtf_chromium.org, aandrey+blink_chromium.org, kouhei+heap_chromium.org, Mikhail, Timur Iskhodzhanov
Project:
blink
Visibility:
Public.

Description

Oilpan: Fix ASan instrumentation around heap object headers. We poison the heap object headers because only our code should ever be able to access them and only from a handful of methods. Poisoning the headers lets us catch stray read/writes that end up in our headers and we use the NO_SANITIZE_ADDRESS annotation on the handful of methods that operate on the headers. The ASan NO_SANITIZE_ADDRESS annotation does not propagate to acquireLoad. Our first attempt to fix that was to unpoison the address accessed. However, that does not work because we are using this code from multiple threads without locking (which is the reason for using atomic ops). Therefore, the threads will have races when it comes to poisoning. This change fixes the issue by introducing asan aware asanAcquireLoad/asanReleaseStore which will work on poisoned memory when you know what you are doing. Kostya, do you have any alternative suggestions? R=erik.corry@gmail.com, kcc@chromium.org, oilpan-reviews@chromium.org, zerny@chromium.org BUG=411712 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181638

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address review comments. #

Patch Set 3 : Don't duplicate. #

Total comments: 2

Patch Set 4 : Address review comments. #

Total comments: 4

Patch Set 5 : Rename #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -11 lines) Patch
M Source/platform/heap/Heap.h View 1 2 3 4 2 chunks +3 lines, -6 lines 0 comments Download
M Source/platform/heap/Heap.cpp View 1 2 3 4 1 chunk +2 lines, -5 lines 0 comments Download
M Source/wtf/Atomics.h View 1 2 3 4 5 chunks +43 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (4 generated)
Mads Ager (chromium)
6 years, 3 months ago (2014-09-08 15:17:12 UTC) #1
kcc1
I am OOO on a conference and this change may require more attention that I ...
6 years, 3 months ago (2014-09-08 16:01:19 UTC) #3
zerny-chromium
https://codereview.chromium.org/556443003/diff/1/Source/platform/heap/Heap.cpp File Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/556443003/diff/1/Source/platform/heap/Heap.cpp#newcode419 Source/platform/heap/Heap.cpp:419: #if defined(ADDRESS_SANITIZER) ditto https://codereview.chromium.org/556443003/diff/1/Source/platform/heap/Heap.h File Source/platform/heap/Heap.h (right): https://codereview.chromium.org/556443003/diff/1/Source/platform/heap/Heap.h#newcode1509 Source/platform/heap/Heap.h:1509: ...
6 years, 3 months ago (2014-09-09 06:01:29 UTC) #4
wibling-chromium
lgtm
6 years, 3 months ago (2014-09-09 07:20:07 UTC) #6
Mads Ager (chromium)
Updated, PTAL. Erik, could you do the WTF review? https://codereview.chromium.org/556443003/diff/1/Source/platform/heap/Heap.cpp File Source/platform/heap/Heap.cpp (right): https://codereview.chromium.org/556443003/diff/1/Source/platform/heap/Heap.cpp#newcode419 Source/platform/heap/Heap.cpp:419: ...
6 years, 3 months ago (2014-09-09 08:22:15 UTC) #7
zerny-chromium
lgtm
6 years, 3 months ago (2014-09-09 08:26:50 UTC) #8
Erik Corry
LGTM, but please wait for an LTGM from Kostya or someone from the ASAN team.
6 years, 3 months ago (2014-09-09 08:36:40 UTC) #9
Alexander Potapenko
https://codereview.chromium.org/556443003/diff/40001/Source/wtf/Atomics.h File Source/wtf/Atomics.h (right): https://codereview.chromium.org/556443003/diff/40001/Source/wtf/Atomics.h#newcode135 Source/wtf/Atomics.h:135: __attribute__((no_sanitize_address)) ALWAYS_INLINE void asanReleaseStore(volatile unsigned* ptr, unsigned value) This ...
6 years, 3 months ago (2014-09-09 09:40:30 UTC) #10
Alexander Potapenko
Ohh, and Chromium isn't C++11-ready yet..
6 years, 3 months ago (2014-09-09 09:46:39 UTC) #11
Mads Ager (chromium)
Yeah, we can't use the C++11 atomics yet. https://codereview.chromium.org/556443003/diff/40001/Source/wtf/Atomics.h File Source/wtf/Atomics.h (right): https://codereview.chromium.org/556443003/diff/40001/Source/wtf/Atomics.h#newcode135 Source/wtf/Atomics.h:135: __attribute__((no_sanitize_address)) ...
6 years, 3 months ago (2014-09-09 09:51:36 UTC) #12
Alexander Potapenko
LGTM https://codereview.chromium.org/556443003/diff/60001/Source/wtf/Atomics.h File Source/wtf/Atomics.h (right): https://codereview.chromium.org/556443003/diff/60001/Source/wtf/Atomics.h#newcode113 Source/wtf/Atomics.h:113: Did you mean adding these blank lines? (Here ...
6 years, 3 months ago (2014-09-09 09:57:30 UTC) #13
Mads Ager (chromium)
https://codereview.chromium.org/556443003/diff/60001/Source/wtf/Atomics.h File Source/wtf/Atomics.h (right): https://codereview.chromium.org/556443003/diff/60001/Source/wtf/Atomics.h#newcode113 Source/wtf/Atomics.h:113: On 2014/09/09 09:57:30, Alexander Potapenko wrote: > Did you ...
6 years, 3 months ago (2014-09-09 10:02:40 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ager@chromium.org/556443003/80001
6 years, 3 months ago (2014-09-09 10:09:43 UTC) #16
commit-bot: I haz the power
Committed patchset #5 (id:80001) as 181638
6 years, 3 months ago (2014-09-09 11:59:40 UTC) #17
Nico
This broke the asan/win build: http://build.chromium.org/p/chromium.fyi/builders/Cr%20Win%20Clang%20%28asan%29/builds/298 C:\b\build\slave\Cr_Win_Clang__asan_\build\src\third_party\WebKit\Source\wtf/Atomics.h(190) : error C2065: 'no_sanitize_address' : undeclared identifier C:\b\build\slave\Cr_Win_Clang__asan_\build\src\third_party\WebKit\Source\wtf/Atomics.h(190) ...
6 years, 3 months ago (2014-09-09 16:33:32 UTC) #19
Nico
…you need to do something like https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/heap/AddressSanitizer.h&l=51 (we try to build the file with clang, ...
6 years, 3 months ago (2014-09-09 16:36:47 UTC) #20
Nico
fix: https://codereview.chromium.org/556863005/
6 years, 3 months ago (2014-09-09 16:47:04 UTC) #21
Mads Ager (chromium)
6 years, 3 months ago (2014-09-09 16:57:18 UTC) #22
Message was sent while issue was closed.
On 2014/09/09 16:47:04, Nico (hiding) wrote:
> fix: https://codereview.chromium.org/556863005/

Thanks for the fix. A half clang half cl build, yikes! ;-)

Powered by Google App Engine
This is Rietveld 408576698