<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>199796</bug_id>
          
          <creation_ts>2019-07-15 04:29:35 -0700</creation_ts>
          <short_desc>Found a bug while fuzzing</short_desc>
          <delta_ts>2019-07-30 10:54:02 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>197634</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="zhoujielun">nine.twelve</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1552818</commentid>
    <comment_count>0</comment_count>
    <who name="zhoujielun">nine.twelve</who>
    <bug_when>2019-07-15 04:29:35 -0700</bug_when>
    <thetext># env 

ubuntu 18.04
webkit cb9ca26

# bug
it crashed in the function WTF::SymbolImpl
    0x1ef6345 &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+5&gt; push   r12
    0x1ef6347 &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+7&gt; push   rbx
    0x1ef6348 &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+8&gt; mov    r15, rsi
 →  0x1ef634b &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+11&gt; mov    r14, rdi
    0x1ef634e &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+14&gt; lea    rdi, [rip+0x9104a7]        # 0x28067fc
    0x1ef6355 &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+21&gt; call   0x7b2890 &lt;__sanitizer_cov_trace_pc_guard&gt;
    0x1ef635a &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+26&gt; mov    ebp, DWORD PTR [r15+0x10]
    0x1ef635e &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+30&gt; mov    eax, ebp
    0x1ef6360 &lt;WTF::SymbolImpl::create(WTF::StringImpl&amp;)+32&gt; and    eax, 0x3


the r15 here is NULL, this is passed from the PrivateName function. The rsi it passed into the chunk is a value from stack, and its NULL.
$r14   : 0x00007fffffffc400  →  0x0000000000000000
When we check the source code, we found that the javascript code triggered the javascript&apos;s internal method Symbol::create(), this function will new a symbol object, and will call Symbol function inside it.
Symbol* Symbol::create(ExecState* exec, JSString* description)
 {
     VM&amp; vm = exec-&gt;vm();
     String desc = description-&gt;value(exec);
     Symbol* symbol = new (NotNull, allocateCell&lt;Symbol&gt;(vm.heap)) Symbol(vm, desc);
     symbol-&gt;finishCreation(vm);
     return symbol;
 }
In this Symbol function, it will call another create function
  45     enum DescriptionTag { Description };
  46     explicit PrivateName(DescriptionTag, const String&amp; description)
  47         : m_uid(SymbolImpl::create(*description.impl()))
  48     {
  49     }
how ever the rsi is NULL...

# poc 

function main() {
function v3(v4,v5,v6,v7,v8) {
    &apos;use strict&apos;
    const v10 = Symbol(v6);
    function v12(v13,v14,v15,v16,v17) {
        &apos;use strict&apos;
        const v20 = [-268435456,-3654755103];
        const v21 = [-3654755103,v20];
        let v24 = v21;
        const v25 = v24.toLocaleString();
        const v26 = v25.padEnd(2147483647,Promise);
        const v27 = v3(Promise,&quot;gBxRp/rynU&quot;,v26);
    }
    const v28 = new Promise(v12);
}
const v29 = new Promise(v3);
}
noDFG(main);
noFTL(main);
main();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1553018</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-07-15 16:14:24 -0700</bug_when>
    <thetext>&lt;rdar://problem/53127278&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1557010</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2019-07-30 10:54:02 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 197634 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>