[tor-bugs] #21134 [Core Tor/Tor]: Fail if file is too large to mmap.

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jan 23 19:16:55 UTC 2017


#21134: Fail if file is too large to mmap.
--------------------------------------------+------------------------------
 Reporter:  junglefowl                      |          Owner:
     Type:  defect                          |         Status:  needs_review
 Priority:  Medium                          |      Milestone:  Tor:
                                            |  0.3.0.x-final
Component:  Core Tor/Tor                    |        Version:  Tor: 0.2.9.8
 Severity:  Normal                          |     Resolution:
 Keywords:  tor_mmap_file, review-group-15  |  Actual Points:
Parent ID:                                  |         Points:
 Reviewer:  nickm                           |        Sponsor:
--------------------------------------------+------------------------------

Comment (by junglefowl):

 Replying to [comment:14 teor]:

 Thank you for your explanation of SIZE_MAX, I always considered it as the
 maximum address space available. I also like your SIZE_T_CEILING
 recommendation a lot, although I adjusted it to SSIZE_T_CEILING so the
 signedness is in sync with off_t.

 This does not support SIZE_MAX though. That is why I uploaded it as a
 second patch file. But I prefer this solution now, because it behaves just
 like the alternative implementation of tor_mmap_file if the memory has to
 be allocated by using malloc (if a system lacks mmap support).

 A 32 bit system could be down to almost 2 GB files, but this still sounds
 very acceptable. It is a common limitation of such systems, even due to a
 signed off_t.

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


More information about the tor-bugs mailing list