Changeset 226778 in webkit


Ignore:
Timestamp:
Jan 11, 2018 7:28:38 AM (6 years ago)
Author:
msaboff@apple.com
Message:

Add a DOM gadget for Spectre testing
https://bugs.webkit.org/show_bug.cgi?id=181351

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

  • runtime/Options.h:

Source/WebCore:

This change is used to test Spectre mitigations.

Added a new DOM class to test for Spectre issues in the DOM layer.
This additional functionality is disabled by default and must be enabled
through the JSC option "enableSpectreGadgets".

  • CMakeLists.txt:
  • DerivedSources.make:
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/WebCoreBuiltinNames.h:
  • dom/SpectreGadget.cpp: Added.

(WebCore::SpectreGadget::SpectreGadget):
(WebCore::SpectreGadget::create):
(WebCore::SpectreGadget::setReadLength):
(WebCore::SpectreGadget::charCodeAt):
(WebCore::SpectreGadget::clflushReadLength):

  • dom/SpectreGadget.h: Added.
  • dom/SpectreGadget.idl: Added.
  • page/RuntimeEnabledFeatures.cpp:

(WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):

  • page/RuntimeEnabledFeatures.h:
Location:
trunk/Source
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r226775 r226778  
     12018-01-11  Michael Saboff  <msaboff@apple.com>
     2
     3        Add a DOM gadget for Spectre testing
     4        https://bugs.webkit.org/show_bug.cgi?id=181351
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * runtime/Options.h:
     9
    1102018-01-11  Yusuke Suzuki  <utatane.tea@gmail.com>
    211
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r226658 r226778  
    461461    v(bool, enableSpectreMitigations, true, Restricted, "Enable Spectre mitigations.") \
    462462    \
     463    v(bool, enableSpectreGadgets, false, Restricted, "enable gadgets to test Spectre mitigations.") \
     464    \
    463465    v(bool, useAsyncIterator, enableAsyncIteration, Normal, "Allow to use Async Iterator in JS.") \
    464466    \
  • trunk/Source/WebCore/CMakeLists.txt

    r226510 r226778  
    597597    dom/ShadowRootMode.idl
    598598    dom/Slotable.idl
     599    dom/SpectreGadget.idl
    599600    dom/StaticRange.idl
    600601    dom/StringCallback.idl
  • trunk/Source/WebCore/ChangeLog

    r226769 r226778  
     12018-01-11  Michael Saboff  <msaboff@apple.com>
     2
     3        Add a DOM gadget for Spectre testing
     4        https://bugs.webkit.org/show_bug.cgi?id=181351
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This change is used to test Spectre mitigations.
     9
     10        Added a new DOM class to test for Spectre issues in the DOM layer.
     11        This additional functionality is disabled by default and must be enabled
     12        through the JSC option "enableSpectreGadgets".
     13
     14        * CMakeLists.txt:
     15        * DerivedSources.make:
     16        * Sources.txt:
     17        * WebCore.xcodeproj/project.pbxproj:
     18        * bindings/js/WebCoreBuiltinNames.h:
     19        * dom/SpectreGadget.cpp: Added.
     20        (WebCore::SpectreGadget::SpectreGadget):
     21        (WebCore::SpectreGadget::create):
     22        (WebCore::SpectreGadget::setReadLength):
     23        (WebCore::SpectreGadget::charCodeAt):
     24        (WebCore::SpectreGadget::clflushReadLength):
     25        * dom/SpectreGadget.h: Added.
     26        * dom/SpectreGadget.idl: Added.
     27        * page/RuntimeEnabledFeatures.cpp:
     28        (WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
     29        * page/RuntimeEnabledFeatures.h:
     30
    1312018-01-11  Philippe Normand  <pnormand@igalia.com>
    232
  • trunk/Source/WebCore/DerivedSources.make

    r226766 r226778  
    514514    $(WebCore)/dom/ShadowRootMode.idl \
    515515    $(WebCore)/dom/Slotable.idl \
     516    $(WebCore)/dom/SpectreGadget.idl \
    516517    $(WebCore)/dom/StaticRange.idl \
    517518    $(WebCore)/dom/StringCallback.idl \
  • trunk/Source/WebCore/Sources.txt

    r226654 r226778  
    788788dom/SlotAssignment.cpp
    789789dom/SpaceSplitString.cpp
     790dom/SpectreGadget.cpp
    790791dom/StaticNodeList.cpp
    791792dom/StaticRange.cpp
     
    29542955JSSourceBuffer.cpp
    29552956JSSourceBufferList.cpp
     2957JSSpectreGadget.cpp
    29562958JSSpeechSynthesis.cpp
    29572959JSSpeechSynthesisEvent.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r226766 r226778  
    17931793                656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17941794                656D37480ADBA5DE00A4554D /* SubresourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1795                657AFAFC20047A2900509464 /* SpectreGadget.h in Headers */ = {isa = PBXBuildFile; fileRef = 657AFAF82004789900509464 /* SpectreGadget.h */; };
    17951796                658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 658436850AE01B7400E53753 /* FrameLoadRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17961797                6593923809AE4346002C531F /* URL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6593923609AE4346002C531F /* URL.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    85078508                656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NetscapePlugInStreamLoader.h; sourceTree = "<group>"; };
    85088509                656D37300ADBA5DE00A4554D /* SubresourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SubresourceLoader.h; sourceTree = "<group>"; };
     8510                657AFAF82004789900509464 /* SpectreGadget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpectreGadget.h; sourceTree = "<group>"; };
     8511                657AFAFA2004789A00509464 /* SpectreGadget.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpectreGadget.idl; sourceTree = "<group>"; };
     8512                657AFAFB2004789A00509464 /* SpectreGadget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpectreGadget.cpp; sourceTree = "<group>"; };
    85098513                658436850AE01B7400E53753 /* FrameLoadRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoadRequest.h; sourceTree = "<group>"; };
    85108514                6593923509AE4346002C531F /* URL.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = URL.cpp; sourceTree = "<group>"; };
     
    2570125705                                D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */,
    2570225706                                D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */,
     25707                                657AFAFB2004789A00509464 /* SpectreGadget.cpp */,
     25708                                657AFAF82004789900509464 /* SpectreGadget.h */,
     25709                                657AFAFA2004789A00509464 /* SpectreGadget.idl */,
    2570325710                                BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */,
    2570425711                                BC7FA62B0D1F0EFF00DB22A9 /* StaticNodeList.h */,
     
    2935029357                                D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */,
    2935129358                                626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */,
     29359                                657AFAFC20047A2900509464 /* SpectreGadget.h in Headers */,
    2935229360                                AA2A5AD416A4861100975A25 /* SpeechSynthesis.h in Headers */,
    2935329361                                AA2A5AD216A4860A00975A25 /* SpeechSynthesisEvent.h in Headers */,
  • trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h

    r226332 r226778  
    140140    macro(ServiceWorkerRegistration) \
    141141    macro(ShadowRoot) \
     142    macro(SpectreGadget) \
    142143    macro(StaticRange) \
    143144    macro(VRDisplay) \
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.cpp

    r226658 r226778  
    3434
    3535#include "MediaPlayer.h"
     36#include <JavaScriptCore/Options.h>
    3637#include <wtf/NeverDestroyed.h>
    3738
     
    5253}
    5354
     55bool RuntimeEnabledFeatures::spectreGadgetsEnabled() const
     56{
     57    return JSC::Options::enableSpectreGadgets();
     58}
     59
    5460#if ENABLE(VIDEO)
    5561bool RuntimeEnabledFeatures::audioEnabled() const
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.h

    r226658 r226778  
    221221#endif
    222222
     223    bool spectreGadgetsEnabled() const;
     224
    223225#if ENABLE(VIDEO)
    224226    bool audioEnabled() const;
Note: See TracChangeset for help on using the changeset viewer.