Bug 141258 - Optimized equal() functions in StringImpl.h are not ASan compatible
Summary: Optimized equal() functions in StringImpl.h are not ASan compatible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-04 12:58 PST by Alexey Proskuryakov
Modified: 2015-02-04 15:38 PST (History)
5 users (show)

See Also:


Attachments
proposed fix (2.58 KB, patch)
2015-02-04 13:55 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2015-02-04 12:58:50 PST
equal() reads out of bounds; we started seeing this after the fix for bug 140873.
Comment 1 Alexey Proskuryakov 2015-02-04 13:55:12 PST
Created attachment 246045 [details]
proposed fix
Comment 2 Daniel Bates 2015-02-04 14:43:17 PST
Comment on attachment 246045 [details]
proposed fix

View in context: https://bugs.webkit.org/attachment.cgi?id=246045&action=review

> Source/WTF/wtf/text/StringImpl.h:878
> +#if (CPU(X86_64) || CPU(ARM64)) && !ASAN_ENABLED

You may want to consider checking ASAN_ENABLED in an if-statement and changing the #if to #elif on this line such that these #if/elif/else-macro blocks look like:

#if ASAN_ENABLED
    ...
#elif CPU(X86_64) || CPU(ARM64)
    ...
...
#else
    ...
#endif

Then we do not need to add the conjunct !ASAN_ENABLED to each macro conditional expression.
Comment 3 Alexey Proskuryakov 2015-02-04 14:57:32 PST
Comment on attachment 246045 [details]
proposed fix

I wanted to keep debug-only code after production code - we usually try to keep the "best" variant first in WebKit code base.
Comment 4 WebKit Commit Bot 2015-02-04 15:38:47 PST
Comment on attachment 246045 [details]
proposed fix

Clearing flags on attachment: 246045

Committed r179644: <http://trac.webkit.org/changeset/179644>
Comment 5 WebKit Commit Bot 2015-02-04 15:38:51 PST
All reviewed patches have been landed.  Closing bug.