Closed Bug 751195 Opened 13 years ago Closed 13 years ago

Turn ASan function instrumentation blacklist into code annotations

Categories

(Core :: JavaScript Engine, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: decoder, Assigned: decoder)

Details

(Keywords: sec-want, Whiteboard: [sg:want][asan-build-blocker])

Attachments

(2 files, 1 obsolete file)

I recently got advised by the Google developers of AddressSanitizer that the way of blacklisting (preventing instrumentation) of functions we use (-mllvm -asan-blacklist file.txt) is deprecated. Instead we should use __attribute__((no_address_safety_analysis)) on every blacklisted function (guarded with an #ifdef MOZ_ASAN so gcc does not warn about the unknown attribute). At the same time, we will be able to remove the build/asan/asan-blacklist.txt file that got recently added. I'm filing this in the JS engine component because all blacklisted functions are located here.
First part, this blacklists the MarkRangeConservatively function.
Assignee: general → choller
Status: NEW → ASSIGNED
Whiteboard: [asan][sg:want] → [asan][sg:want][autoland-try]
Whiteboard: [asan][sg:want][autoland-try] → [asan][sg:want][autoland-in-queue]
Manually sent this to try since autoland seems to be broken.
Whiteboard: [asan][sg:want][autoland-in-queue] → [asan][sg:want]
Attachment #620652 - Flags: review?(bhackett1024)
We won't need any further blacklisting for now as per discussion with espindola, we will be building debug+opt builds to avoid stack space exhaustion. If this becomes an issue later, we can still prevent certain functions from being instrumented or inlined.
Comment on attachment 620652 [details] [diff] [review] [Part 1] Annotate MarkRangeConservatively function Review of attachment 620652 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/public/Utility.h @@ +98,5 @@ > #define JS_STATIC_ASSERT_IF(cond, expr) MOZ_STATIC_ASSERT_IF(cond, expr, "JS_STATIC_ASSERT_IF") > > + > +#ifdef MOZ_ASAN > +#define MOZ_ASAN_BLACKLIST JS_NEVER_INLINE __attribute__((no_address_safety_analysis)) Please move this to mfbt/Attributes.h and use MOZ_NEVER_INLINE instead.
Attachment #620652 - Flags: review?(bhackett1024) → review+
Address review comments, looks much better like this. Thanks billm! :) Carrying r+ and requesting checkin.
Attachment #620652 - Attachment is obsolete: true
Attachment #621223 - Flags: review+
Attachment #621223 - Flags: checkin?(gary)
Attachment #620920 - Flags: checkin?(gary)
Attachment #620920 - Flags: checkin?(gary) → checkin+
Attachment #621223 - Flags: checkin?(gary) → checkin+
Whiteboard: [asan][sg:want] → [sg:want][asan-build-blocker]
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Autoland Patchset: Patches: 620652 Branch: mozilla-central => try Patch 620652 could not be applied to mozilla-central. patching file js/src/jsgc.cpp Hunk #1 FAILED at 1079 1 out of 1 hunks FAILED -- saving rejects to file js/src/jsgc.cpp.rej patch failed, unable to continue (try -v) patch failed, rejects left in working dir Patch 620652 could not be applied to mozilla-central. patching file js/public/Utility.h Hunk #1 FAILED at 91 1 out of 1 hunks FAILED -- saving rejects to file js/public/Utility.h.rej patching file js/src/jsgc.cpp Hunk #1 FAILED at 1079 1 out of 1 hunks FAILED -- saving rejects to file js/src/jsgc.cpp.rej patch failed, unable to continue (try -v) patch failed, rejects left in working dir Patchset could not be applied and pushed.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: