<?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>203419</bug_id>
          
          <creation_ts>2019-10-25 09:04:48 -0700</creation_ts>
          <short_desc>[iOS] Fix sandbox violations seen while running layout tests</short_desc>
          <delta_ts>2019-10-28 16:58:52 -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>WebKit Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</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>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Per Arne Vollan">pvollan</reporter>
          <assigned_to name="Per Arne Vollan">pvollan</assigned_to>
          <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1583844</commentid>
    <comment_count>0</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2019-10-25 09:04:48 -0700</bug_when>
    <thetext>Deny mach lookup to &apos;com.apple.logd&apos; and &apos;com.apple.logd.events&apos; and suppress logs, since these are believed to be unneeded in the WebContent process.
Allow sysctl write to &apos;vm.footprint_suspend&apos; internally.
Deny mach lookup to &apos;com.apple.system.notification_center&apos; and suppress logs, since allowing this is not believed to be needed in the WebContent process.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1583850</commentid>
    <comment_count>1</comment_count>
      <attachid>381930</attachid>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2019-10-25 09:09:06 -0700</bug_when>
    <thetext>Created attachment 381930
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1583864</commentid>
    <comment_count>2</comment_count>
      <attachid>381930</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2019-10-25 09:41:36 -0700</bug_when>
    <thetext>Comment on attachment 381930
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1583870</commentid>
    <comment_count>3</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2019-10-25 09:47:51 -0700</bug_when>
    <thetext>(In reply to Brent Fulgham from comment #2)
&gt; Comment on attachment 381930 [details]
&gt; Patch
&gt; 
&gt; r=me

Thanks for reviewing!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1583944</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-10-25 12:03:08 -0700</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 381930:

imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/integrity.html bug 203394 (author: ysuzuki@apple.com)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1583945</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-10-25 12:03:09 -0700</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 381930:

The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1584097</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-10-25 16:59:54 -0700</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 381930:

imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/integrity.html bug 203394 (author: ysuzuki@apple.com)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1584098</commentid>
    <comment_count>7</comment_count>
      <attachid>381930</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-10-25 17:00:38 -0700</bug_when>
    <thetext>Comment on attachment 381930
Patch

Clearing flags on attachment: 381930

Committed r251612: &lt;https://trac.webkit.org/changeset/251612&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1584099</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-10-25 17:00:39 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1584102</commentid>
    <comment_count>9</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-10-25 17:01:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/56637619&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1584360</commentid>
    <comment_count>10</comment_count>
      <attachid>381930</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-10-27 18:43:13 -0700</bug_when>
    <thetext>Comment on attachment 381930
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381930&amp;action=review

&gt; Source/WebKit/ChangeLog:11
&gt; +        Deny mach lookup to &apos;com.apple.logd&apos; and &apos;com.apple.logd.events&apos; and suppress logs, since these are
&gt; +        believed to be unneeded in the WebContent process. Allow sysctl write to &apos;vm.footprint_suspend&apos;.
&gt; +        Deny mach lookup to &apos;com.apple.system.notification_center&apos; and suppress logs, since allowing this
&gt; +        is not believed to be needed in the WebContent process.

Where can stack traces for these violations be seen? It seems quite counter-intuitive that we do not need these connections.

Can you document these decisions in the associated radar, if they cannot be documented here? Right now, there is nearly zero paper trail for why these dangerous changes were made.

&gt; Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:482
&gt; +(with-filter (system-attribute apple-internal)
&gt; +    (allow sysctl-read sysctl-write
&gt; +           (sysctl-name &quot;vm.footprint_suspend&quot;)))

&quot;system-attribute apple-internal&quot; is not what it seems. This change allows vm.footprint_suspend on some AppleInternal installs, but not on others, and it&apos;s unlikely that this is what you were after. You can see &lt;rdar://problem/55853605&gt; for some discussion of the differences.

But also, footprint is a publicly shipping tool. What specifically about vm.footprint_suspend makes it AppleInternal only?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1584753</commentid>
    <comment_count>11</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2019-10-28 16:58:52 -0700</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #10)
&gt; Comment on attachment 381930 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=381930&amp;action=review
&gt; 
&gt; &gt; Source/WebKit/ChangeLog:11
&gt; &gt; +        Deny mach lookup to &apos;com.apple.logd&apos; and &apos;com.apple.logd.events&apos; and suppress logs, since these are
&gt; &gt; +        believed to be unneeded in the WebContent process. Allow sysctl write to &apos;vm.footprint_suspend&apos;.
&gt; &gt; +        Deny mach lookup to &apos;com.apple.system.notification_center&apos; and suppress logs, since allowing this
&gt; &gt; +        is not believed to be needed in the WebContent process.
&gt; 
&gt; Where can stack traces for these violations be seen? It seems quite
&gt; counter-intuitive that we do not need these connections.
&gt; 
&gt; Can you document these decisions in the associated radar, if they cannot be
&gt; documented here? Right now, there is nearly zero paper trail for why these
&gt; dangerous changes were made.
&gt; 

You are absolutely right. I have reverted most of these changes in https://bugs.webkit.org/show_bug.cgi?id=203505, except for access to &apos;com.apple.logd.events&apos;, which is not being looked up during layout tests.

&gt; &gt; Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:482
&gt; &gt; +(with-filter (system-attribute apple-internal)
&gt; &gt; +    (allow sysctl-read sysctl-write
&gt; &gt; +           (sysctl-name &quot;vm.footprint_suspend&quot;)))
&gt; 
&gt; &quot;system-attribute apple-internal&quot; is not what it seems. This change allows
&gt; vm.footprint_suspend on some AppleInternal installs, but not on others, and
&gt; it&apos;s unlikely that this is what you were after. You can see
&gt; &lt;rdar://problem/55853605&gt; for some discussion of the differences.
&gt; 
&gt; But also, footprint is a publicly shipping tool. What specifically about
&gt; vm.footprint_suspend makes it AppleInternal only?

See comment in &lt;rdar://problem/56637619&gt;.

Thanks for reviewing!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>381930</attachid>
            <date>2019-10-25 09:09:06 -0700</date>
            <delta_ts>2019-10-25 17:00:38 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-203419-20191025090905.patch</filename>
            <type>text/plain</type>
            <size>3045</size>
            <attacher name="Per Arne Vollan">pvollan</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XZWJL
aXQvQ2hhbmdlTG9nCShyZXZpc2lvbiAyNTE1OTIpCisrKyBTb3VyY2UvV2ViS2l0L0NoYW5nZUxv
Zwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE5IEBACisyMDE5LTEwLTI1ICBQZXIgQXJuZSBW
b2xsYW4gIDxwdm9sbGFuQGFwcGxlLmNvbT4KKworICAgICAgICBbaU9TXSBGaXggc2FuZGJveCB2
aW9sYXRpb25zIHNlZW4gd2hpbGUgcnVubmluZyBsYXlvdXQgdGVzdHMKKyAgICAgICAgaHR0cHM6
Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIwMzQxOQorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIERlbnkgbWFjaCBsb29rdXAgdG8gJ2Nv
bS5hcHBs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XIiKSkKKyhkZW55IGlwYy1wb3NpeC1zaG0tcmVhZCogKHdpdGggbm8tcmVwb3J0KQorICAgICAg
IChpcGMtcG9zaXgtbmFtZSAiYXBwbGUuc2htLm5vdGlmaWNhdGlvbl9jZW50ZXIiKSkKIAogKGxv
Z2QtZGlhZ25vc3RpYy1jbGllbnQpCiAK
</data>

          </attachment>
      

    </bug>

</bugzilla>