<?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>236670</bug_id>
          
          <creation_ts>2022-02-15 14:41:04 -0800</creation_ts>
          <short_desc>OSAllocatorPosix::tryReserveUncommittedAligned() should not use PROT_NONE on non-linux platforms</short_desc>
          <delta_ts>2022-02-22 14:42:18 -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>Platform</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=236625</see_also>
          <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="Yoshiaki Jitsukawa">yoshiaki.jitsukawa</reporter>
          <assigned_to name="Basuke Suzuki">basuke</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1841950</commentid>
    <comment_count>0</comment_count>
    <who name="Yoshiaki Jitsukawa">yoshiaki.jitsukawa</who>
    <bug_when>2022-02-15 14:41:04 -0800</bug_when>
    <thetext>OSAllocatorPosix::tryReserveUncommittedAligned() should not use PROT_NONE on non-linux platforms.

Only on linux PROT_NONE is used for deccommitted pages. That is, protection flags are set on commit() only on Linux. 
https://github.com/WebKit/WebKit/blob/9067a50/Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp#L228

However in tryReserveUncommittedAligned() PROT_NONE is used for platforms other than
 #if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK),
which may result in protection faults because appropriate flags won&apos;t be set on commit().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1842935</commentid>
    <comment_count>1</comment_count>
    <who name="Basuke Suzuki">basuke</who>
    <bug_when>2022-02-17 09:25:53 -0800</bug_when>
    <thetext>(In reply to Yoshiaki Jitsukawa from comment #0)
&gt; OSAllocatorPosix::tryReserveUncommittedAligned() should not use PROT_NONE on
&gt; non-linux platforms.
&gt; 
&gt; Only on linux PROT_NONE is used for deccommitted pages. That is, protection
&gt; flags are set on commit() only on Linux. 
&gt; https://github.com/WebKit/WebKit/blob/9067a50/Source/WTF/wtf/posix/
&gt; OSAllocatorPOSIX.cpp#L228
&gt; 
&gt; However in tryReserveUncommittedAligned() PROT_NONE is used for platforms
&gt; other than
&gt;  #if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK),
&gt; which may result in protection faults because appropriate flags won&apos;t be set
&gt; on commit().

Linux implementation is so much depends on Linux memory management way and very different from other port.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1844876</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-02-22 14:42:18 -0800</bug_when>
    <thetext>&lt;rdar://problem/89317522&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>