Bug 164834 - ExceptionFuzz functions should use its client's ThrowScope.
Summary: ExceptionFuzz functions should use its client's ThrowScope.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-16 13:57 PST by Mark Lam
Modified: 2016-11-16 15:18 PST (History)
8 users (show)

See Also:


Attachments
proposed patch. (7.03 KB, patch)
2016-11-16 14:03 PST, Mark Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2016-11-16 13:57:16 PST
This is because ExceptionFuzz's purpose is to throw exceptions from its client at exception check sites.  Using the client's ThrowScope solves 2 problems:

1. If ExceptionFuzz makes its own ThrowScope, the simulated throw will be mis-attributed to ExceptionFuzz when it should be attributed to its client.

2. One way exception scope verification works is by having ThrowScopes assert that there are no unchecked simulated exceptions when the ThrowScope is instantiated.  However, ExceptionFuzz necessarily works by inserting doExceptionFuzzingIfEnabled() between a ThrowScope that simulated a throw and an exception check.  If we declare a ThrowScope in ExceptionFuzz's code, we will be instantiating a ThrowScope between the point where a simulated throw occurs and where the needed exception check can occur.  Hence, having ExceptionFuzz instantiate its own ThrowScope will fail exception scope verification every time.

Changing ExceptionFuzz to use its client's ThrowScope resolves both problems.
Comment 1 Mark Lam 2016-11-16 14:03:35 PST
Created attachment 294973 [details]
proposed patch.
Comment 2 WebKit Commit Bot 2016-11-16 14:04:52 PST
Attachment 294973 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ChangeLog:17:  Please consider whether the use of security-sensitive phrasing could help someone exploit WebKit: fuzzing, fuzzing, fuzzing  [changelog/unwantedsecurityterms] [3]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2016-11-16 14:10:50 PST
Comment on attachment 294973 [details]
proposed patch.

r=me
Comment 4 Mark Lam 2016-11-16 14:52:32 PST
Comment on attachment 294973 [details]
proposed patch.

Thanks for the review.  Landing via cq.
Comment 5 WebKit Commit Bot 2016-11-16 15:18:16 PST
Comment on attachment 294973 [details]
proposed patch.

Clearing flags on attachment: 294973

Committed r208819: <http://trac.webkit.org/changeset/208819>
Comment 6 WebKit Commit Bot 2016-11-16 15:18:21 PST
All reviewed patches have been landed.  Closing bug.