<?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>54167</bug_id>
          
          <creation_ts>2011-02-09 22:12:28 -0800</creation_ts>
          <short_desc>REGRESSION(r78149): Return value of read() shouldn&apos;t be ignored.</short_desc>
          <delta_ts>2011-02-11 10:41:42 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Jarred Nicholls">jarred</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>pvarga</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>348813</commentid>
    <comment_count>0</comment_count>
    <who name="Jarred Nicholls">jarred</who>
    <bug_when>2011-02-09 22:12:28 -0800</bug_when>
    <thetext>Build break for gcc 4.4.5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348814</commentid>
    <comment_count>1</comment_count>
      <attachid>81924</attachid>
    <who name="Jarred Nicholls">jarred</who>
    <bug_when>2011-02-09 22:15:46 -0800</bug_when>
    <thetext>Created attachment 81924
Proposed patch

use return value of read in both debug and release modes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348861</commentid>
    <comment_count>2</comment_count>
      <attachid>81924</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-10 00:45:52 -0800</bug_when>
    <thetext>Comment on attachment 81924
Proposed patch

Why not just use the CRASH() version in both debug and release?

A quick web search suggests that reads from /dev/urandom never fails in practice, just possibly degrading quality (not sure if there&apos;s a proper spec for this). I&apos;m wondering if one Web page will be able to predict random numbers generated in other pages by exhausting OS randomness first.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348864</commentid>
    <comment_count>3</comment_count>
    <who name="Jarred Nicholls">jarred</who>
    <bug_when>2011-02-10 00:48:58 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 81924 [details])
&gt; Why not just use the CRASH() version in both debug and release?
&gt; 

Yeah I suppose I could.  I don&apos;t ever predict /dev/urandom to fail to provide the exact number of requested bytes.  I&apos;ll revise.

&gt; A quick web search suggests that reads from /dev/urandom never fails in practice, just possibly degrading quality (not sure if there&apos;s a proper spec for this). I&apos;m wondering if one Web page will be able to predict random numbers generated in other pages by exhausting OS randomness first.

Good thought.  May want to hit up the Chromium team who added this :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348866</commentid>
    <comment_count>4</comment_count>
      <attachid>81934</attachid>
    <who name="Jarred Nicholls">jarred</who>
    <bug_when>2011-02-10 00:50:53 -0800</bug_when>
    <thetext>Created attachment 81934
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348953</commentid>
    <comment_count>5</comment_count>
      <attachid>81934</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-10 04:46:38 -0800</bug_when>
    <thetext>Comment on attachment 81934
Proposed patch

Clearing flags on attachment: 81934

Committed r78203: &lt;http://trac.webkit.org/changeset/78203&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348954</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-10 04:46:47 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>348966</commentid>
    <comment_count>7</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2011-02-10 05:05:42 -0800</bug_when>
    <thetext>*** Bug 54190 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349181</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-10 10:48:42 -0800</bug_when>
    <thetext>Adam, I&apos;m still curious about your thoughts on the issue of Web content abusing randomness source, and thus affecting other pages (and even other processes?!). Is there a rate limit or some other protection against that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349312</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-10 13:09:09 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; Adam, I&apos;m still curious about your thoughts on the issue of Web content abusing randomness source, and thus affecting other pages (and even other processes?!). Is there a rate limit or some other protection against that?

Access to OS randomness is mediated by a cryptographic PRNG in WTF.  There shouldn&apos;t be a problem with sharing the crypto PRNG with other web pages.  If there was, that would be an attack on RC4, and we&apos;d have bigger problems!

Now, there&apos;s the question of whether it&apos;s dangerous to let web pages pull from OS randomness, even mediated by a PRNG.  I don&apos;t think that&apos;s overly dangerous.  In many common scenarios, web pages can already pull from OS randomness.  For example, the &lt;keygen&gt; element lets you generate certificates, which requires a bunch of OS randomness.  As another example, WTF::randomNumber backends to arc4random on Mac, which backends to /dev/urandom.  To the extent that web pages can cause WebKit to call WTF::randomNumber, they can already convince us to extract randomness from the OS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349835</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-02-11 10:41:42 -0800</bug_when>
    <thetext>&gt; Now, there&apos;s the question of whether it&apos;s dangerous to let web pages pull from OS randomness, even mediated by a PRNG.

Yes, that&apos;s my concern. Perhaps this hasn&apos;t been exploited yet, but it seems likely to be exploitable.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>81924</attachid>
            <date>2011-02-09 22:15:46 -0800</date>
            <delta_ts>2011-02-10 00:50:53 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>read-return.patch</filename>
            <type>text/plain</type>
            <size>1368</size>
            <attacher name="Jarred Nicholls">jarred</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IGRhMDE5NTUuLmIzODUzMzIgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL0phdmFTY3JpcHRD
b3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDExLTAyLTA5ICBKYXJyZWQgTmljaG9s
bHMgIDxqYXJyZWRAc2VuY2hhLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICBSRUdSRVNTSU9OKHI3ODE0OSk6IFJldHVybiB2YWx1ZSBvZiByZWFk
KCkgc2hvdWxkbid0IGJlIGlnbm9yZWQuCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3Jn
L3Nob3dfYnVnLmNnaT9pZD01NDE2NworICAgICAgICAKKyAgICAgICAgc3RkaW8gcmVhZCBzaG91
bGQgaGF2ZSBpdHMgcmV0dXJuIHZhbHVlIGhhbmRsZWQuIEJ1aWxkIGVycm9yIGluIGdjYyA0LjQu
NS4KKworICAgICAgICAqIHd0Zi9PU1JhbmRvbVNvdXJjZS5jcHA6CisgICAgICAgIChXVEY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BpIDwgbGVuZ3RoOyBpKyspIHsK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>81934</attachid>
            <date>2011-02-10 00:50:53 -0800</date>
            <delta_ts>2011-02-10 04:46:38 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>read-return.patch</filename>
            <type>text/plain</type>
            <size>1261</size>
            <attacher name="Jarred Nicholls">jarred</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IGRhMDE5NTUuLmIzODUzMzIgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL0phdmFTY3JpcHRD
b3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDExLTAyLTA5ICBKYXJyZWQgTmljaG9s
bHMgIDxqYXJyZWRAc2VuY2hhLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICBSRUdSRVNTSU9OKHI3ODE0OSk6IFJldHVybiB2YWx1ZSBvZiByZWFk
KCkgc2hvdWxkbid0IGJlIGlnbm9yZWQuCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3Jn
L3Nob3dfYnVnLmNnaT9pZD01NDE2NworICAgICAgICAKKyAgICAgICAgc3RkaW8gcmVhZCBzaG91
bGQgaGF2ZSBpdHMgcmV0dXJuIHZhbHVlIGhhbmRsZWQuIEJ1aWxkIGVycm9yIGluIGdjYyA0LjQu
NS4KKworICAgICAgICAqIHd0Zi9PU1JhbmRvbVNvdXJjZS5jcHA6CisgICAgICAgIChXVEY6OnJh
bmRvbVZhbHVlc0Zyb21PUyk6CisKIDIwMTEtMDItMDkgIEdhdmluIEJhcnJhY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