WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
181351
Add a DOM gadget for Spectre testing
https://bugs.webkit.org/show_bug.cgi?id=181351
Summary
Add a DOM gadget for Spectre testing
Michael Saboff
Reported
2018-01-05 15:28:48 PST
A "gadget" added to a DOM node type would allow us to test DOM binding and supporting code mitigations.
Attachments
Patch
(6.67 KB, patch)
2018-01-05 15:49 PST
,
Michael Saboff
saam
: review+
ews-watchlist
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-elcapitan
(2.36 MB, application/zip)
2018-01-05 16:52 PST
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
(3.32 MB, application/zip)
2018-01-05 17:19 PST
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews117 for mac-elcapitan
(3.36 MB, application/zip)
2018-01-05 17:44 PST
,
EWS Watchlist
no flags
Details
Patch for landing - took care of review feedback and fixed test failure
(6.70 KB, patch)
2018-01-08 15:02 PST
,
Michael Saboff
no flags
Details
Formatted Diff
Diff
Patch
(16.24 KB, patch)
2018-01-10 14:49 PST
,
Michael Saboff
no flags
Details
Formatted Diff
Diff
Patch with speculative build fix for GTK
(16.68 KB, patch)
2018-01-10 15:34 PST
,
Michael Saboff
rniwa
: review+
ews-watchlist
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews101 for mac-sierra
(2.48 MB, application/zip)
2018-01-10 19:02 PST
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews116 for mac-sierra
(3.17 MB, application/zip)
2018-01-10 19:18 PST
,
EWS Watchlist
no flags
Details
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2018-01-05 15:32:23 PST
<
rdar://problem/36329006
>
Michael Saboff
Comment 2
2018-01-05 15:49:31 PST
Created
attachment 330601
[details]
Patch
EWS Watchlist
Comment 3
2018-01-05 15:51:58 PST
Attachment 330601
[details]
did not pass style-queue: ERROR: Source/WebCore/dom/Comment.cpp:89: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/ChangeLog:10: Please consider whether the use of security-sensitive phrasing could help someone exploit WebKit: vulnerab [changelog/unwantedsecurityterms] [3] Total errors found: 2 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Saam Barati
Comment 4
2018-01-05 16:33:57 PST
Comment on
attachment 330601
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=330601&action=review
> Source/WebCore/dom/Comment.h:45 > + const unsigned m_maxDataLength = 100u;
lets make this constexpr
EWS Watchlist
Comment 5
2018-01-05 16:52:46 PST
Comment on
attachment 330601
[details]
Patch
Attachment 330601
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/5948013
New failing tests: inspector/model/remote-object-dom.html
EWS Watchlist
Comment 6
2018-01-05 16:52:48 PST
Created
attachment 330608
[details]
Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
EWS Watchlist
Comment 7
2018-01-05 17:19:25 PST
Comment on
attachment 330601
[details]
Patch
Attachment 330601
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/5948170
New failing tests: inspector/model/remote-object-dom.html
EWS Watchlist
Comment 8
2018-01-05 17:19:27 PST
Created
attachment 330616
[details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
EWS Watchlist
Comment 9
2018-01-05 17:44:01 PST
Comment on
attachment 330601
[details]
Patch
Attachment 330601
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/5948392
New failing tests: svg/wicd/rightsizing-grid.xhtml inspector/model/remote-object-dom.html
EWS Watchlist
Comment 10
2018-01-05 17:44:03 PST
Created
attachment 330624
[details]
Archive of layout-test-results from ews117 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Michael Saboff
Comment 11
2018-01-08 15:02:07 PST
Created
attachment 330742
[details]
Patch for landing - took care of review feedback and fixed test failure
EWS Watchlist
Comment 12
2018-01-08 15:04:13 PST
Attachment 330742
[details]
did not pass style-queue: ERROR: Source/WebCore/dom/Comment.cpp:91: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 13
2018-01-08 17:07:33 PST
Comment on
attachment 330742
[details]
Patch for landing - took care of review feedback and fixed test failure Clearing flags on attachment: 330742 Committed
r226600
: <
https://trac.webkit.org/changeset/226600
>
WebKit Commit Bot
Comment 14
2018-01-08 17:07:35 PST
All reviewed patches have been landed. Closing bug.
Don Olmstead
Comment 15
2018-01-08 17:52:54 PST
This is breaking windows builds and looks like iOS as well.
Alexey Proskuryakov
Comment 16
2018-01-08 17:53:23 PST
Comment on
attachment 330742
[details]
Patch for landing - took care of review feedback and fixed test failure View in context:
https://bugs.webkit.org/attachment.cgi?id=330742&action=review
> Source/WebCore/dom/Comment.h:47 > + Vector<int32_t> m_data; > + size_t m_readLength; > + int32_t* m_dataPtr;
It still feels weird to me to pay a runtime cost for the test in customer builds.
Ryosuke Niwa
Comment 17
2018-01-08 18:00:37 PST
Comment on
attachment 330742
[details]
Patch for landing - took care of review feedback and fixed test failure View in context:
https://bugs.webkit.org/attachment.cgi?id=330742&action=review
> Source/WebCore/dom/Comment.h:45 > + Vector<int32_t> m_data;
Wow, we can't do this to a comment node. Websites have a lot of comment nodes.
Saam Barati
Comment 18
2018-01-08 18:18:54 PST
(In reply to Alexey Proskuryakov from
comment #16
)
> Comment on
attachment 330742
[details]
> Patch for landing - took care of review feedback and fixed test failure > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=330742&action=review
> > > Source/WebCore/dom/Comment.h:47 > > + Vector<int32_t> m_data; > > + size_t m_readLength; > > + int32_t* m_dataPtr; > > It still feels weird to me to pay a runtime cost for the test in customer > builds.
Michael has a plan to only do this for engineering builds.
Saam Barati
Comment 19
2018-01-08 18:19:04 PST
(In reply to Ryosuke Niwa from
comment #17
)
> Comment on
attachment 330742
[details]
> Patch for landing - took care of review feedback and fixed test failure > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=330742&action=review
> > > Source/WebCore/dom/Comment.h:45 > > + Vector<int32_t> m_data; > > Wow, we can't do this to a comment node. > Websites have a lot of comment nodes.
Michael has a plan to only do this for engineering builds.
Saam Barati
Comment 20
2018-01-08 18:19:36 PST
(In reply to Saam Barati from
comment #19
)
> (In reply to Ryosuke Niwa from
comment #17
) > > Comment on
attachment 330742
[details]
> > Patch for landing - took care of review feedback and fixed test failure > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=330742&action=review
> > > > > Source/WebCore/dom/Comment.h:45 > > > + Vector<int32_t> m_data; > > > > Wow, we can't do this to a comment node. > > Websites have a lot of comment nodes. > > Michael has a plan to only do this for engineering builds.
That said, maybe this will hurt our ability to test. If so, we should probably just add brand new internal API for spectre testing. Shouldn't be hard.
Alexey Proskuryakov
Comment 21
2018-01-09 11:33:46 PST
Can we roll back until the better solution can be designed?
Michael Saboff
Comment 22
2018-01-09 13:47:43 PST
(In reply to Alexey Proskuryakov from
comment #21
)
> Can we roll back until the better solution can be designed?
Rolled out in
r226658
.
Michael Saboff
Comment 23
2018-01-10 14:49:43 PST
Created
attachment 330969
[details]
Patch
EWS Watchlist
Comment 24
2018-01-10 14:52:31 PST
Attachment 330969
[details]
did not pass style-queue: ERROR: Source/WebCore/dom/SpectreGadget.cpp:72: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Michael Saboff
Comment 25
2018-01-10 15:34:44 PST
Created
attachment 330976
[details]
Patch with speculative build fix for GTK
EWS Watchlist
Comment 26
2018-01-10 15:38:06 PST
Attachment 330976
[details]
did not pass style-queue: ERROR: Source/WebCore/dom/SpectreGadget.cpp:72: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebCore/ChangeLog:14: Need whitespace between colon and description [changelog/filechangedescriptionwhitespace] [5] Total errors found: 2 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 27
2018-01-10 18:14:24 PST
Please rename to InspectreGadget.
EWS Watchlist
Comment 28
2018-01-10 19:02:23 PST
Comment on
attachment 330976
[details]
Patch with speculative build fix for GTK
Attachment 330976
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/6028202
New failing tests: accessibility/mac/aria-multiple-liveregions-notification.html
EWS Watchlist
Comment 29
2018-01-10 19:02:25 PST
Created
attachment 331010
[details]
Archive of layout-test-results from ews101 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 30
2018-01-10 19:18:46 PST
Comment on
attachment 330976
[details]
Patch with speculative build fix for GTK
Attachment 330976
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/6028256
New failing tests: http/tests/misc/slow-loading-animated-image.html
EWS Watchlist
Comment 31
2018-01-10 19:18:48 PST
Created
attachment 331012
[details]
Archive of layout-test-results from ews116 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-sierra Platform: Mac OS X 10.12.6
Joseph Pecoraro
Comment 32
2018-01-10 19:36:28 PST
Comment on
attachment 330976
[details]
Patch with speculative build fix for GTK View in context:
https://bugs.webkit.org/attachment.cgi?id=330976&action=review
Much better!
> Source/WebCore/Sources.txt:787 > +dom/SpectreGadget.cpp
Style: Not in alphabetical order like all the rest.
> Source/WebCore/WebCore.xcodeproj/project.pbxproj:1795 > + 657AFAFC20047A2900509464 /* SpectreGadget.h in Headers */ = {isa = PBXBuildFile; fileRef = 657AFAF82004789900509464 /* SpectreGadget.h */; settings = {ATTRIBUTES = (Private, ); }; };
This doesn't appear to need to be Private. Nobody includes this outside of WebCore, right?
> Source/WebCore/WebCore.xcodeproj/project.pbxproj:26238 > + 657AFAFC20047A2900509464 /* SpectreGadget.h in Headers */,
This section could be sorted: ./Tools/Scripts/sort-Xcode-project-file Source/WebCore/WebCore.xcodeproj/project.pbxproj
> Source/WebCore/bindings/js/WebCoreBuiltinNames.h:142 > + macro(SpectreGadget) \
What is this one needed for? Is there builtin code for SpectreGadget? I would only expect this would be needed if there was an @SpectreGadget use in builtins or a need for SpectreGadgetPrivateName.
> Source/WebCore/dom/SpectreGadget.h:26 > + > +
Style: Too many empty lines
> Source/WebCore/dom/SpectreGadget.idl:28 > + // Conditional=PREPROCESS_MACRO
No need for this comment, please remove.
> Source/WebCore/dom/SpectreGadget.idl:31 > + JSGenerateToJSObject,
This doesn't appear to be necessary, I don't see any code that converts this class to a JSObject explicitly.
Michael Saboff
Comment 33
2018-01-10 20:20:24 PST
(In reply to Joseph Pecoraro from
comment #32
)
> Comment on
attachment 330976
[details]
> Patch with speculative build fix for GTK > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=330976&action=review
> > Much better! > > > Source/WebCore/Sources.txt:787 > > +dom/SpectreGadget.cpp > > Style: Not in alphabetical order like all the rest.
Fixed.
> > Source/WebCore/WebCore.xcodeproj/project.pbxproj:1795 > > + 657AFAFC20047A2900509464 /* SpectreGadget.h in Headers */ = {isa = PBXBuildFile; fileRef = 657AFAF82004789900509464 /* SpectreGadget.h */; settings = {ATTRIBUTES = (Private, ); }; }; > > This doesn't appear to need to be Private. Nobody includes this outside of > WebCore, right?
Made it Project.
> > Source/WebCore/WebCore.xcodeproj/project.pbxproj:26238 > > + 657AFAFC20047A2900509464 /* SpectreGadget.h in Headers */,
>
> This section could be sorted:
Done.
> ./Tools/Scripts/sort-Xcode-project-file > Source/WebCore/WebCore.xcodeproj/project.pbxproj > > > Source/WebCore/bindings/js/WebCoreBuiltinNames.h:142 > > + macro(SpectreGadget) \ > > What is this one needed for? Is there builtin code for SpectreGadget? I > would only expect this would be needed if there was an @SpectreGadget use in > builtins or a need for SpectreGadgetPrivateName.
It is needed to add the constructor to the GlobalObject.
> > Source/WebCore/dom/SpectreGadget.h:26 > > + > > + > > Style: Too many empty lines
Fixed
> > Source/WebCore/dom/SpectreGadget.idl:28 > > + // Conditional=PREPROCESS_MACRO > > No need for this comment, please remove.
For the future, but I removed it.
> > Source/WebCore/dom/SpectreGadget.idl:31 > > + JSGenerateToJSObject, > > This doesn't appear to be necessary, I don't see any code that converts this > class to a JSObject explicitly.
Copy / paste error - removed.
Joseph Pecoraro
Comment 34
2018-01-10 20:25:41 PST
Comment on
attachment 330976
[details]
Patch with speculative build fix for GTK View in context:
https://bugs.webkit.org/attachment.cgi?id=330976&action=review
>>> Source/WebCore/bindings/js/WebCoreBuiltinNames.h:142 >>> + macro(SpectreGadget) \ >> >> What is this one needed for? Is there builtin code for SpectreGadget? I would only expect this would be needed if there was an @SpectreGadget use in builtins or a need for SpectreGadgetPrivateName. > > It is needed to add the constructor to the GlobalObject.
Hmm, that doesn't make sense to me. That is the [Exposed=Window] IDL interface attribute should do. This file appears to be specific to "Builtins". What fails when you remove this line?
Michael Saboff
Comment 35
2018-01-10 21:09:51 PST
(In reply to Joseph Pecoraro from
comment #34
)
> Comment on
attachment 330976
[details]
> Patch with speculative build fix for GTK > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=330976&action=review
> > >>> Source/WebCore/bindings/js/WebCoreBuiltinNames.h:142 > >>> + macro(SpectreGadget) \ > >> > >> What is this one needed for? Is there builtin code for SpectreGadget? I would only expect this would be needed if there was an @SpectreGadget use in builtins or a need for SpectreGadgetPrivateName. > > > > It is needed to add the constructor to the GlobalObject. > > Hmm, that doesn't make sense to me. That is the [Exposed=Window] IDL > interface attribute should do. > > This file appears to be specific to "Builtins". What fails when you remove > this line?
In file included from /Volumes/Data/src/webkit/WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource19.cpp:5: /Volumes/Data/src/webkit/WebKitBuild/Release/DerivedSources/WebCore/JSDOMWindow.cpp:6299:97: error: no member named 'SpectreGadgetPublicName' in 'WebCore::WebCoreBuiltinNames' putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().SpectreGadgetPublicName(), CustomGetterSetter::create(vm, jsDOMWindowSpectreGadgetConstructor, setJSDOMWindowSpectreGadgetConstructor), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum))); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ 1 error generated.
Joseph Pecoraro
Comment 36
2018-01-10 21:43:28 PST
Comment on
attachment 330976
[details]
Patch with speculative build fix for GTK View in context:
https://bugs.webkit.org/attachment.cgi?id=330976&action=review
>>>>> Source/WebCore/bindings/js/WebCoreBuiltinNames.h:142 >>>>> + macro(SpectreGadget) \ >>>> >>>> What is this one needed for? Is there builtin code for SpectreGadget? I would only expect this would be needed if there was an @SpectreGadget use in builtins or a need for SpectreGadgetPrivateName. >>> >>> It is needed to add the constructor to the GlobalObject. >> >> Hmm, that doesn't make sense to me. That is the [Exposed=Window] IDL interface attribute should do. >> >> This file appears to be specific to "Builtins". What fails when you remove this line? > > In file included from /Volumes/Data/src/webkit/WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource19.cpp:5: > /Volumes/Data/src/webkit/WebKitBuild/Release/DerivedSources/WebCore/JSDOMWindow.cpp:6299:97: error: no member named 'SpectreGadgetPublicName' in 'WebCore::WebCoreBuiltinNames' > putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().SpectreGadgetPublicName(), CustomGetterSetter::create(vm, jsDOMWindowSpectreGadgetConstructor, setJSDOMWindowSpectreGadgetConstructor), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum))); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ > 1 error generated.
Oh very interesting! So apparently the *PublicName this is needed when the interface has the EnabledAtRuntime IDL attribute. That is good for me to know in the future. Thanks!
Joseph Pecoraro
Comment 37
2018-01-10 21:51:07 PST
I was mislead by WebCoreBuiltinNames's WEBCORE_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME macro. Despite saying _PRIVATE_ it is used to create both a PublicName and PrivateName identifier. In some cases this wastes time and bytes creating identifiers that won't ever be needed or used. But this is no longer relevant to your patch.
Michael Saboff
Comment 38
2018-01-11 07:28:41 PST
Committed
r226778
: <
https://trac.webkit.org/changeset/226778
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug