<?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>250024</bug_id>
          
          <creation_ts>2023-01-03 07:37:51 -0800</creation_ts>
          <short_desc>[WASM][ARM64] Type confused of StackVisitor in JSC::StackVisitor::visit</short_desc>
          <delta_ts>2023-01-17 16:17:51 -0800</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>WebKit Local Build</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="CAO ZONG">cz18811105578</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>hackerzheng666</cc>
    
    <cc>justin_michaud</cc>
    
    <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1922619</commentid>
    <comment_count>0</comment_count>
      <attachid>464306</attachid>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-01-03 07:37:51 -0800</bug_when>
    <thetext>Created attachment 464306
Reproducible poc

ASSERTION FAILED: cell
/Users/x/Desktop/AFL-WASM-main/WebKit_patch/Source/JavaScriptCore/runtime/JSObject.h(1363) : JSC::JSObject *JSC::asObject(JSC::JSCell *)
1   0x10bf45b58 WTFCrash
2   0x109cebd30 JSC::ARM64Assembler::insn(int)
3   0x109cbbfd8 JSC::asObject(JSC::JSCell*)
4   0x109cbbf60 JSC::asObject(JSC::JSValue)
5   0x10b542ea4 JSC::Register::object() const
6   0x109c9f524 JSC::CallFrame::jsCallee() const
7   0x10b396b88 JSC::CallFrame::isStackOverflowFrame() const
8   0x10afd8460 JSC::StackVisitor::StackVisitor(JSC::CallFrame*, JSC::VM&amp;)
9   0x10afd888c JSC::StackVisitor::StackVisitor(JSC::CallFrame*, JSC::VM&amp;)
10  0x10afcfd6c void JSC::StackVisitor::visit&lt;(JSC::StackVisitor::EmptyEntryFrameAction)0, JSC::Interpreter::getStackTrace(JSC::JSCell*, WTF::Vector&lt;JSC::StackFrame, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;, unsigned long, unsigned long)::$_6&gt;(JSC::CallFrame*, JSC::VM&amp;, JSC::Interpreter::getStackTrace(JSC::JSCell*, WTF::Vector&lt;JSC::StackFrame, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;, unsigned long, unsigned long)::$_6 const&amp;)
11  0x10afcfc14 JSC::Interpreter::getStackTrace(JSC::JSCell*, WTF::Vector&lt;JSC::StackFrame, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;, unsigned long, unsigned long)
12  0x10b48e128 JSC::getStackTrace(JSC::JSGlobalObject*, JSC::VM&amp;, JSC::JSObject*, bool)
13  0x10b4908bc JSC::ErrorInstance::finishCreation(JSC::VM&amp;, JSC::JSGlobalObject*, WTF::String const&amp;, JSC::JSValue, WTF::String (*)(WTF::String const&amp;, WTF::StringView, JSC::RuntimeType, JSC::ErrorInstance::SourceTextWhereErrorOccurred), JSC::RuntimeType, bool)
14  0x10bdf56a0 JSC::ErrorInstance::create(JSC::JSGlobalObject*, JSC::VM&amp;, JSC::Structure*, WTF::String const&amp;, JSC::JSValue, WTF::String (*)(WTF::String const&amp;, WTF::StringView, JSC::RuntimeType, JSC::ErrorInstance::SourceTextWhereErrorOccurred), JSC::RuntimeType, JSC::ErrorType, bool)
15  0x10bdf889c JSC::createJSWebAssemblyRuntimeError(JSC::JSGlobalObject*, JSC::VM&amp;, JSC::Wasm::ExceptionType)
16  0x10bd5c394 operationWasmToJSException
17  0x10bd8cfb0 slow_path_wasm_throw_exception
18  0x109b77f44 wasmLLIntPCRangeStart
19  0x100000000 (null)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922620</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-03 07:38:03 -0800</bug_when>
    <thetext>&lt;rdar://problem/103834422&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922621</commentid>
    <comment_count>2</comment_count>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-01-03 07:40:38 -0800</bug_when>
    <thetext>This poc crashes the jsc on ARM64
commit: 8bacbc1a234b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922622</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-03 07:40:47 -0800</bug_when>
    <thetext>&lt;rdar://problem/103834490&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1923801</commentid>
    <comment_count>4</comment_count>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-01-07 07:35:24 -0800</bug_when>
    <thetext>friendly ping</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924236</commentid>
    <comment_count>5</comment_count>
      <attachid>464433</attachid>
    <who name="Justin Michaud">justin_michaud</who>
    <bug_when>2023-01-09 17:38:19 -0800</bug_when>
    <thetext>Created attachment 464433
Simple poc

Nice catch! 

1) This test case requires both SIMD and tail calls

2) I am guessing that many of these bugs all stem from the same source

3) I have attached a super simple poc:

(module
  (func $start (export &quot;start&quot;)
    (call $f1))
  (func $f1
    (local v128)
    (try
      (do)
      (catch_all))
    (return_call $f2))
  (func $f2)
)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924237</commentid>
    <comment_count>6</comment_count>
      <attachid>464434</attachid>
    <who name="Justin Michaud">justin_michaud</who>
    <bug_when>2023-01-09 17:38:34 -0800</bug_when>
    <thetext>Created attachment 464434
Simple poc driver</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924352</commentid>
    <comment_count>7</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-01-10 02:18:14 -0800</bug_when>
    <thetext>This is tail-call specific issue. Let&apos;s just fix it in public repository since it isn&apos;t shipped yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924353</commentid>
    <comment_count>8</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-01-10 02:22:26 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/8450</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924354</commentid>
    <comment_count>9</comment_count>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-01-10 02:46:00 -0800</bug_when>
    <thetext>All the spec this POC required is enabled by DEFAULT, so I think the spec is READY to ship. The security label need to be kept anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924474</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-10 08:40:20 -0800</bug_when>
    <thetext>Committed 258725@main (0eced4e49803): &lt;https://commits.webkit.org/258725@main&gt;

Reviewed commits have been landed. Closing PR #8450 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924506</commentid>
    <comment_count>11</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2023-01-10 10:17:52 -0800</bug_when>
    <thetext>(In reply to CAO ZONG from comment #9)
&gt; All the spec this POC required is enabled by DEFAULT, so I think the spec is
&gt; READY to ship. The security label need to be kept anyway.

Hi Cao, it&apos;s not considered a security issue because this is newly developed code that has not been deployed on any platforms yet.  Thanks for reporting the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924509</commentid>
    <comment_count>12</comment_count>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-01-10 10:37:21 -0800</bug_when>
    <thetext>(In reply to Mark Lam from comment #11)
&gt; (In reply to CAO ZONG from comment #9)
&gt; &gt; All the spec this POC required is enabled by DEFAULT, so I think the spec is
&gt; &gt; READY to ship. The security label need to be kept anyway.
&gt; 
&gt; Hi Cao, it&apos;s not considered a security issue because this is newly developed
&gt; code that has not been deployed on any platforms yet.  Thanks for reporting
&gt; the bug.

Hello Mark! 
Well, According to Apple Security Bounty Guidelines &quot;For example, security issues that are unique to newly added features or code in developer or public beta releases — including newly introduced regressions...&quot;, I think the bug in newly developed code need also considered for security impact. So will this issue be assigned CVE or any acknowledge?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924513</commentid>
    <comment_count>13</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2023-01-10 10:44:13 -0800</bug_when>
    <thetext>(In reply to CAO ZONG from comment #12)
&gt; (In reply to Mark Lam from comment #11)
&gt; &gt; (In reply to CAO ZONG from comment #9)
&gt; &gt; &gt; All the spec this POC required is enabled by DEFAULT, so I think the spec is
&gt; &gt; &gt; READY to ship. The security label need to be kept anyway.
&gt; &gt; 
&gt; &gt; Hi Cao, it&apos;s not considered a security issue because this is newly developed
&gt; &gt; code that has not been deployed on any platforms yet.  Thanks for reporting
&gt; &gt; the bug.
&gt; 
&gt; Hello Mark! 
&gt; Well, According to Apple Security Bounty Guidelines &quot;For example, security
&gt; issues that are unique to newly added features or code in developer or
&gt; public beta releases — including newly introduced regressions...&quot;, I think
&gt; the bug in newly developed code need also considered for security impact. So
&gt; will this issue be assigned CVE or any acknowledge?

The WebKit open source project does not and cannot speak for Apple Security. Please contact them for clarification.  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924514</commentid>
    <comment_count>14</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2023-01-10 10:45:20 -0800</bug_when>
    <thetext>&lt;rdar://problem/103834422&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924515</commentid>
    <comment_count>15</comment_count>
    <who name="CAO ZONG">cz18811105578</who>
    <bug_when>2023-01-10 10:49:40 -0800</bug_when>
    <thetext>(In reply to Mark Lam from comment #13)
&gt; (In reply to CAO ZONG from comment #12)
&gt; &gt; (In reply to Mark Lam from comment #11)
&gt; &gt; &gt; (In reply to CAO ZONG from comment #9)
&gt; &gt; &gt; &gt; All the spec this POC required is enabled by DEFAULT, so I think the spec is
&gt; &gt; &gt; &gt; READY to ship. The security label need to be kept anyway.
&gt; &gt; &gt; 
&gt; &gt; &gt; Hi Cao, it&apos;s not considered a security issue because this is newly developed
&gt; &gt; &gt; code that has not been deployed on any platforms yet.  Thanks for reporting
&gt; &gt; &gt; the bug.
&gt; &gt; 
&gt; &gt; Hello Mark! 
&gt; &gt; Well, According to Apple Security Bounty Guidelines &quot;For example, security
&gt; &gt; issues that are unique to newly added features or code in developer or
&gt; &gt; public beta releases — including newly introduced regressions...&quot;, I think
&gt; &gt; the bug in newly developed code need also considered for security impact. So
&gt; &gt; will this issue be assigned CVE or any acknowledge?
&gt; 
&gt; The WebKit open source project does not and cannot speak for Apple Security.
&gt; Please contact them for clarification.  Thanks.


OK, and thanks for your patient reply :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926117</commentid>
    <comment_count>16</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-01-17 15:53:00 -0800</bug_when>
    <thetext>*** Bug 249700 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926120</commentid>
    <comment_count>17</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-01-17 16:05:12 -0800</bug_when>
    <thetext>*** Bug 249935 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926124</commentid>
    <comment_count>18</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-01-17 16:08:40 -0800</bug_when>
    <thetext>*** Bug 250008 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926135</commentid>
    <comment_count>19</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-01-17 16:17:51 -0800</bug_when>
    <thetext>*** Bug 249762 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>464306</attachid>
            <date>2023-01-03 07:37:51 -0800</date>
            <delta_ts>2023-01-03 07:37:51 -0800</delta_ts>
            <desc>Reproducible poc</desc>
            <filename>poc0103-2.js</filename>
            <type>text/javascript</type>
            <size>1276</size>
            <attacher name="CAO ZONG">cz18811105578</attacher>
            
              <data encoding="base64">dmFyIHdhc21fY29kZSA9IG5ldyBVaW50OEFycmF5KFswLDk3LDExNSwxMDksMSwwLDAsMCwxLDE0
MiwxMjgsMTI4LDEyOCwwLDMsOTYsMywxMjcsMTI3LDEyNywxLDEyNyw5NiwwLDAsOTYsMCwwLDMs
MTMyLDEyOCwxMjgsMTI4LDAsMywwLDEsMSw0LDEzMywxMjgsMTI4LDEyOCwwLDEsMTEyLDEsMyw3
LDUsMTMyLDEyOCwxMjgsMTI4LDAsMSwxLDE2LDMyLDEzLDEzMSwxMjgsMTI4LDEyOCwwLDEsMCwx
LDYsMTYwLDEyOSwxMjgsMTI4LDAsMTUsMTI3LDAsNjUsMCwxMSwxMjQsMSw2OCwwLDAsMCwwLDAs
MCwwLDAsMTEsMTI0LDEsNjgsMCwwLDAsMCwwLDAsMCwwLDExLDEyNywxLDY1LDAsMTEsMTIzLDEs
MjUzLDEyLDAsMCwwLDAsMCwwLDAsMCwwLDAsM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cgV2ViQXNzZW1ibHkuTW9kdWxlKHdhc21fY29kZSk7CnZhciB3YXNtX2luc3RhbmNlID0g
bmV3IFdlYkFzc2VtYmx5Lkluc3RhbmNlKHdhc21fbW9kdWxlKTsKdmFyIGYgPSB3YXNtX2luc3Rh
bmNlLmV4cG9ydHMubWFpbjsKZigpOw==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>464433</attachid>
            <date>2023-01-09 17:38:19 -0800</date>
            <delta_ts>2023-01-09 17:38:19 -0800</delta_ts>
            <desc>Simple poc</desc>
            <filename>poc.wat</filename>
            <type>text/plain</type>
            <size>162</size>
            <attacher name="Justin Michaud">justin_michaud</attacher>
            
              <data encoding="base64">KG1vZHVsZQogIChmdW5jICRzdGFydCAoZXhwb3J0ICJzdGFydCIpCiAgICAoY2FsbCAkZjEpKQog
IChmdW5jICRmMQogICAgKGxvY2FsIHYxMjgpCiAgICAodHJ5CiAgICAgIChkbykKICAgICAgKGNh
dGNoX2FsbCkpCiAgICAocmV0dXJuX2NhbGwgJGYyKSkKICAoZnVuYyAkZjIpCikK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>464434</attachid>
            <date>2023-01-09 17:38:34 -0800</date>
            <delta_ts>2023-01-09 17:38:34 -0800</delta_ts>
            <desc>Simple poc driver</desc>
            <filename>poc.js</filename>
            <type>application/x-javascript</type>
            <size>226</size>
            <attacher name="Justin Michaud">justin_michaud</attacher>
            
              <data encoding="base64">dmFyIHdhc21fY29kZSA9IHJlYWQoIi9Vc2Vycy9qdXN0aW5fbWljaGF1ZC9EZXNrdG9wL3BvYy53
YXNtIiwgImJpbmFyeSIpCnZhciB3YXNtX21vZHVsZSA9IG5ldyBXZWJBc3NlbWJseS5Nb2R1bGUo
d2FzbV9jb2RlKTsKdmFyIHdhc21faW5zdGFuY2UgPSBuZXcgV2ViQXNzZW1ibHkuSW5zdGFuY2Uo
d2FzbV9tb2R1bGUpOwp2YXIgZiA9IHdhc21faW5zdGFuY2UuZXhwb3J0cy5zdGFydDsKZigpOw==
</data>

          </attachment>
      

    </bug>

</bugzilla>