Changeset 258717 in webkit


Ignore:
Timestamp:
Mar 19, 2020 11:28:58 AM (4 years ago)
Author:
ysuzuki@apple.com
Message:

sanitizeStackForVMImpl writes below stack pointer, triggers huge warning spam from valgrind
https://bugs.webkit.org/show_bug.cgi?id=199295

Reviewed by Mark Lam.

During sanitizeStackForVMImpl, we should not access to the region beyond the stack-pointer.
This patch changes stack-pointer while sanitizeStackForVMImpl is zero-filling the old stack region.

  • llint/LowLevelInterpreter.asm:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r258698 r258717  
     12020-03-18  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        sanitizeStackForVMImpl writes below stack pointer, triggers huge warning spam from valgrind
     4        https://bugs.webkit.org/show_bug.cgi?id=199295
     5
     6        Reviewed by Mark Lam.
     7
     8        During sanitizeStackForVMImpl, we should not access to the region beyond the stack-pointer.
     9        This patch changes stack-pointer while sanitizeStackForVMImpl is zero-filling the old stack region.
     10
     11        * llint/LowLevelInterpreter.asm:
     12
    1132020-03-19  Charlie Turner  <cturner@igalia.com>
    214
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r257466 r258717  
    14191419            loadp 4[sp], a0
    14201420        end
    1421         const vm = a0
     1421        const vmOrStartSP = a0
    14221422        const address = a1
    14231423        const zeroValue = a2
    14241424   
    1425         loadp VM::m_lastStackTop[vm], address
     1425        loadp vmOrStartSP::m_lastStackTop[vmOrStartSP], address
     1426        move sp, zeroValue
     1427        storep zeroValue, vmOrStartSP::m_lastStackTop[vmOrStartSP]
     1428        move sp, vmOrStartSP
     1429
    14261430        bpbeq sp, address, .zeroFillDone
    1427    
     1431        move address, sp
     1432
    14281433        move 0, zeroValue
    14291434    .zeroFillLoop:
    14301435        storep zeroValue, [address]
    14311436        addp PtrSize, address
    1432         bpa sp, address, .zeroFillLoop
     1437        bpa vmOrStartSP, address, .zeroFillLoop
    14331438
    14341439    .zeroFillDone:
    1435         move sp, address
    1436         storep address, VM::m_lastStackTop[vm]
     1440        move vmOrStartSP, sp
    14371441        ret
    14381442   
Note: See TracChangeset for help on using the changeset viewer.