<?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>106162</bug_id>
          
          <creation_ts>2013-01-04 18:49:34 -0800</creation_ts>
          <short_desc>Pending container size requests can be cleared earlier</short_desc>
          <delta_ts>2013-01-07 12:35: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>SVG</component>
          <version>420+</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Rogers">pdr</reporter>
          <assigned_to name="Philip Rogers">pdr</assigned_to>
          <cc>eric</cc>
    
    <cc>fmalita</cc>
    
    <cc>inferno</cc>
    
    <cc>japhet</cc>
    
    <cc>schenney</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>800813</commentid>
    <comment_count>0</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-01-04 18:49:34 -0800</bug_when>
    <thetext>CachedImage::CreateImage() only clears m_pendingContainerSizeRequests if for images that use container sizes due to a trivial mistake in http://trac.webkit.org/changeset/137981</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801462</commentid>
    <comment_count>1</comment_count>
      <attachid>181535</attachid>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-01-07 11:18:32 -0800</bug_when>
    <thetext>Created attachment 181535
First pass</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801479</commentid>
    <comment_count>2</comment_count>
      <attachid>181535</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-01-07 11:31:07 -0800</bug_when>
    <thetext>Comment on attachment 181535
First pass

Were they never being cleared?  Was this effectively a leak?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801498</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-01-07 11:51:13 -0800</bug_when>
    <thetext>I guess my question is... would m_pendingContainerSizeRequests have grown w/o bounds before this?  If so, it seems trivial to make a page which would trigger that.  In general do we worry about this vector growing without bounds?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801525</commentid>
    <comment_count>4</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-01-07 12:03:14 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 181535 [details])
&gt; Were they never being cleared?  Was this effectively a leak?

This isn&apos;t a leak because they would still be cleared when we destructed the CachedImage, we just keep them around too long.

This issue only exists because in https://bugs.webkit.org/show_bug.cgi?id=105097#c3 you asked for me to clear these requests and I made the change without another round of reviews. This patch is just cleaning up my unreviewed mess :)



(In reply to comment #3)
&gt; I guess my question is... would m_pendingContainerSizeRequests have grown w/o bounds before this?  If so, it seems trivial to make a page which would trigger that.  In general do we worry about this vector growing without bounds?

m_pendingContainerSizeRequests should only be used between the time an image is requested and when it is created. Because these requests are stored as a pair of the renderer and the size, this vector could only grow massive if there were an infinite number of renderers all referencing a single image where all the renderers layout before the image loads.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801531</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-01-07 12:05:24 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; I guess my question is... would m_pendingContainerSizeRequests have grown w/o bounds before this?  If so, it seems trivial to make a page which would trigger that.  In general do we worry about this vector growing without bounds?
&gt; 
&gt; m_pendingContainerSizeRequests should only be used between the time an image is requested and when it is created. Because these requests are stored as a pair of the renderer and the size, this vector could only grow massive if there were an infinite number of renderers all referencing a single image where all the renderers layout before the image loads.

I see.  So if you change the size of a loading-image after initial layout it does not create an additional pending size request?  So an &quot;attacker&quot; of this vector would have to create N images in order to create N size change requests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801536</commentid>
    <comment_count>6</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-01-07 12:13:15 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; I guess my question is... would m_pendingContainerSizeRequests have grown w/o bounds before this?  If so, it seems trivial to make a page which would trigger that.  In general do we worry about this vector growing without bounds?
&gt; &gt; 
&gt; &gt; m_pendingContainerSizeRequests should only be used between the time an image is requested and when it is created. Because these requests are stored as a pair of the renderer and the size, this vector could only grow massive if there were an infinite number of renderers all referencing a single image where all the renderers layout before the image loads.
&gt; 
&gt; I see.  So if you change the size of a loading-image after initial layout it does not create an additional pending size request?  So an &quot;attacker&quot; of this vector would have to create N images in order to create N size change requests?

Yeah, you&apos;ve got it exactly right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801537</commentid>
    <comment_count>7</comment_count>
      <attachid>181535</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-01-07 12:14:05 -0800</bug_when>
    <thetext>Comment on attachment 181535
First pass

OK, so this really is then a perf/memory fix, and not a leak or security fix.  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801551</commentid>
    <comment_count>8</comment_count>
      <attachid>181535</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-01-07 12:35:14 -0800</bug_when>
    <thetext>Comment on attachment 181535
First pass

Clearing flags on attachment: 181535

Committed r138976: &lt;http://trac.webkit.org/changeset/138976&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>801553</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-01-07 12:35:18 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>181535</attachid>
            <date>2013-01-07 11:18:32 -0800</date>
            <delta_ts>2013-01-07 12:35:14 -0800</delta_ts>
            <desc>First pass</desc>
            <filename>106162.1.patch</filename>
            <type>text/plain</type>
            <size>2211</size>
            <attacher name="Philip Rogers">pdr</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEzODk2NSkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIwIEBACisyMDEzLTAxLTA3ICBQaGlsaXAg
Um9nZXJzICA8cGRyQGdvb2dsZS5jb20+CisKKyAgICAgICAgQ2xlYXIgcGVuZGluZyBjb250YWlu
ZXIgc2l6ZSByZXF1ZXN0cyBhcyBlYXJseSBhcyBwb3NzaWJsZQorICAgICAgICBodHRwczovL2J1
Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTA2MTYyCisKKyAgICAgICAgUmV2aWV3ZWQg
YnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgaHR0cDovL3RyYWMud2Via2l0Lm9yZy9jaGFu
Z2VzZXQvMTM3OTgxIGNvbnRhaW5lZCBhIGJ1ZyB3aGVyZSBwZW5kaW5nIGNvbnRhaW5lciBz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Wx1ZS5zZWNvbmQpOworICAgICAgICB9CiAgICAgICAgIG1fcGVu
ZGluZ0NvbnRhaW5lclNpemVSZXF1ZXN0cy5jbGVhcigpOwogICAgIH0KIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>