⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286969 in webkit


Ignore:
Timestamp:
Dec 13, 2021, 12:25:56 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

ExecutableAllocator: Do not store things in g_config when USE(SYSTEM_MALLOC).
https://bugs.webkit.org/show_bug.cgi?id=232165

Patch by waddlesplash <waddlesplash@gmail.com> on 2021-12-13
Reviewed by Yusuke Suzuki.

Following r281910 two additional slots were added
to g_config in order to store these pointers for use in bmalloc and Gigacage. However, when
USE(SYSTEM_MALLOC) is enabled, there are no slots reserved for Gigacage, and so this collided
with g_wtfConfig and overwrote data there instead.

This should fix crashes seen on Haiku, which enables USE(SYSTEM_MALLOC).

  • jit/ExecutableAllocator.cpp:

(JSC::initializeJITPageReservation):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r286958 r286969  
     12021-12-13  waddlesplash  <waddlesplash@gmail.com>
     2
     3        ExecutableAllocator: Do not store things in g_config when USE(SYSTEM_MALLOC).
     4        https://bugs.webkit.org/show_bug.cgi?id=232165
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Following r281910 two additional slots were added
     9        to g_config in order to store these pointers for use in bmalloc and Gigacage. However, when
     10        USE(SYSTEM_MALLOC) is enabled, there are no slots reserved for Gigacage, and so this collided
     11        with g_wtfConfig and overwrote data there instead.
     12
     13        This should fix crashes seen on Haiku, which enables USE(SYSTEM_MALLOC).
     14
     15        * jit/ExecutableAllocator.cpp:
     16        (JSC::initializeJITPageReservation):
     17
    1182021-12-13  Elliott Williams  <emw@apple.com>
    219
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp

    r284135 r286969  
    404404        g_jscConfig.endExecutableMemory = tagCodePtr<ExecutableMemoryPtrTag>(reservationEnd);
    405405
    406 #if ENABLE(UNIFIED_AND_FREEZABLE_CONFIG_RECORD)
     406#if !USE(SYSTEM_MALLOC) && ENABLE(UNIFIED_AND_FREEZABLE_CONFIG_RECORD)
    407407        WebConfig::g_config[0] = bitwise_cast<uintptr_t>(reservation.base);
    408408        WebConfig::g_config[1] = bitwise_cast<uintptr_t>(reservationEnd);
Note: See TracChangeset for help on using the changeset viewer.