Bug 184280 - Don't do index masking or poisoning for DirectArguments
Summary: Don't do index masking or poisoning for DirectArguments
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-03 15:57 PDT by Filip Pizlo
Modified: 2018-04-04 11:00 PDT (History)
6 users (show)

See Also:


Attachments
the patch (74.05 KB, patch)
2018-04-03 16:27 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (69.53 KB, patch)
2018-04-03 16:28 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (67.74 KB, patch)
2018-04-03 16:58 PDT, Filip Pizlo
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2018-04-03 15:57:27 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2018-04-03 16:27:39 PDT
Created attachment 337126 [details]
the patch
Comment 2 Filip Pizlo 2018-04-03 16:28:10 PDT
Comment on attachment 337126 [details]
the patch

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

> Source/JavaScriptCore/ChangeLog:-2936
> -2018-03-09  Filip Pizlo  <fpizlo@apple.com>
> -
> -        Split DirectArguments into JSValueOOB and JSValueStrict parts
> -        https://bugs.webkit.org/show_bug.cgi?id=183458
> -
> -        Reviewed by Yusuke Suzuki.
> -        
> -        Our Spectre plan for JSValue objects is to allow inline JSValue stores and loads guarded by
> -        unmitigated structure checks. This works because objects reachable from JSValues (i.e. JSValue
> -        objects, like String, Symbol, and any descendant of JSObject) will only contain fields that it's OK
> -        to read and write within a Spectre mitigation window. Writes are important, because within the
> -        window, a write could appear to be made speculatively and rolled out later. This means that:
> -        
> -        - JSValue objects cannot have lengths, masks, or anything else inline.
> -        
> -        - JSValue objects cannot have an inline type that is used as part of a Spectre mitigation for a type
> -          check, unless that type is in the form of a poison key.
> -        
> -        This means that the dynamic poisoning that I previously landed for DirectArguments is wrong. It also
> -        means that it's wrong for DirectArguments to have an inline length.
> -        
> -        This changes DirectArguments to use poisoning according to the universal formula:
> -        
> -        - The random accessed portions are out-of-line, pointed to by a poisoned pointer.
> -        
> -        - No inline length.
> -        
> -        Surprisingly, this is perf-neutral. It's probably perf-neutral because our compiler optimizations
> -        amortize whatever cost there was.
> -

I'll revert this.
Comment 3 Filip Pizlo 2018-04-03 16:28:52 PDT
Created attachment 337128 [details]
the patch
Comment 4 EWS Watchlist 2018-04-03 16:33:49 PDT
Attachment 337128 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/DirectArguments.h:123:  Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION().  [security/assertion] [5]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Filip Pizlo 2018-04-03 16:58:57 PDT
Created attachment 337132 [details]
the patch
Comment 6 EWS Watchlist 2018-04-03 17:01:12 PDT
Attachment 337132 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/DirectArguments.h:123:  Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION().  [security/assertion] [5]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Saam Barati 2018-04-04 10:44:02 PDT
Comment on attachment 337132 [details]
the patch

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

rs=me

> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:15570
> +    LValue dynamicPoison(LValue value, LValue poison)

Do we still need these?
Comment 8 Filip Pizlo 2018-04-04 10:59:00 PDT
Landed in https://trac.webkit.org/changeset/230266/webkit
Comment 9 Radar WebKit Bug Importer 2018-04-04 10:59:16 PDT
<rdar://problem/39180055>
Comment 10 Filip Pizlo 2018-04-04 11:00:07 PDT
(In reply to Saam Barati from comment #7)
> Comment on attachment 337132 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=337132&action=review
> 
> rs=me
> 
> > Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:15570
> > +    LValue dynamicPoison(LValue value, LValue poison)
> 
> Do we still need these?

Probably not.  We might still use them for scoped arguments poisoning or something.  I'll kill them once I'm done killing other things.