[tor-bugs] #17799 [Core Tor/Tor]: Hash All PRNG output before use

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Apr 21 02:24:14 UTC 2016


#17799: Hash All PRNG output before use
-------------------------------+----------------------------------------
 Reporter:  teor               |          Owner:  nickm
     Type:  defect             |         Status:  needs_review
 Priority:  Medium             |      Milestone:  Tor: 0.2.9.x-final
Component:  Core Tor/Tor       |        Version:  Tor: unspecified
 Severity:  Normal             |     Resolution:
 Keywords:  TorCoreTeam201604  |  Actual Points:
Parent ID:                     |         Points:  small/medium-remaining
 Reviewer:  asn                |        Sponsor:
-------------------------------+----------------------------------------

Comment (by cypherpunks):

 {{{
 static void *
 new_prng_page(void)
 {
   const size_t sz = sizeof(shake_prng_t);
   void *result = mmap(NULL, sz,
                       PROT_READ | PROT_WRITE,
                       MAP_ANON | MAP_PRIVATE,
                       -1, 0);
   tor_assert(result);
 }}}
 Bug: Failure is indicated with MAP_FAILED (-1).

 In `free_prng_page` you test for `!page`, so if you don't like null
 addresses maybe you would want to
 {{{
 tor_assert(result && result != MAP_FAILED)
 }}}

 Nit: The Linux manpage says MAP_ANON is deprecated in favor of
 MAP_ANONYMOUS.

 I have other comments, but I'll wait until I've read more as there are
 things I don't fully understand yet.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17799#comment:33>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list