Ignore:
Timestamp:
Aug 2, 2018, 5:14:11 PM (7 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore:
Reading instructionPointer from PlatformRegisters may fail when using pointer profiling
https://bugs.webkit.org/show_bug.cgi?id=188271
<rdar://problem/42850884>

Reviewed by Michael Saboff.

This patch defends against the instructionPointer containing garbage bits.
See radar for details.

  • runtime/MachineContext.h:

(JSC::MachineContext::instructionPointer):

  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::takeSample):

  • runtime/VMTraps.cpp:

(JSC::SignalContext::SignalContext):
(JSC::SignalContext::tryCreate):

  • tools/CodeProfiling.cpp:

(JSC::profilingTimer):

  • tools/SigillCrashAnalyzer.cpp:

(JSC::SignalContext::SignalContext):
(JSC::SignalContext::tryCreate):
(JSC::SignalContext::dump):
(JSC::installCrashHandler):

  • wasm/WasmFaultSignalHandler.cpp:

(JSC::Wasm::trapHandler):

Source/WTF:
Reading instructionPointer from PlatformRegisters may fail when using pointer tagging
https://bugs.webkit.org/show_bug.cgi?id=188271
<rdar://problem/42850884>

Reviewed by Michael Saboff.

  • wtf/PtrTag.h:

(WTF::isTaggedWith):
(WTF::usesPointerTagging):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/CodeProfiling.cpp

    r230826 r234528  
    7272{
    7373    PlatformRegisters& platformRegisters = WTF::registersFromUContext(static_cast<ucontext_t*>(uap));
    74     CodeProfiling::sample(
    75         MachineContext::instructionPointer(platformRegisters).untaggedExecutableAddress(),
    76         reinterpret_cast<void**>(MachineContext::framePointer(platformRegisters)));
     74    if (auto instructionPointer = MachineContext::instructionPointer(platformRegisters)) {
     75        CodeProfiling::sample(
     76            instructionPointer->untaggedExecutableAddress(),
     77            reinterpret_cast<void**>(MachineContext::framePointer(platformRegisters)));
     78    }
    7779}
    7880#endif
Note: See TracChangeset for help on using the changeset viewer.