[tor-bugs] #18320 [Core Tor/Tor]: Clear old entries from the key-pinning journal file

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jun 9 00:52:50 UTC 2016


#18320: Clear old entries from the key-pinning journal file
----------------------------------------+----------------------------------
 Reporter:  teor                        |          Owner:  andrea
     Type:  defect                      |         Status:  needs_review
 Priority:  Medium                      |      Milestone:  Tor:
Component:  Core Tor/Tor                |  0.2.9.x-final
 Severity:  Normal                      |        Version:
 Keywords:  tor-dos, TorCoreTeam201606  |     Resolution:
Parent ID:  #17293                      |  Actual Points:
 Reviewer:                              |         Points:  3
                                        |        Sponsor:  SponsorU-can
----------------------------------------+----------------------------------
Changes (by andrea):

 * status:  assigned => needs_review


Comment:

 Proposed fix in my ticket18320_squashed branch, including new unit test.
 There are two relevant things worth considering whether to adjust here:

  * How often should we prune?  Right now we invoke the pruner each time a
 dirauth starts up, before loading the keypinning journal.
  * What should we do if we encounter problems while writing the pruned
 keypinning journal?  See new comment from keypin.c:

 {{{
 676     /*
 677      * Loading into the pruner succeeded; truncate the old file and
 emit
 678      *
 679      * The output should always be smaller than the original file was,
 but
 680      * under really pessimal circumstances, something else might
 gobble up
 681      * a lot of disk space before we're done emitting and we might
 fail to
 682      * emit and end up losing the journal.
 683      *
 684      * The alternative would be to emit to a temp file and then only
 delete
 685      * the old journal when we've written the new one, but then we
 might fail
 686      * to prune when disk space is tight.
 687      */
 }}}

 This has been tested using a small alternate dirauth set as well as the
 unit test for the pruner.

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


More information about the tor-bugs mailing list