[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#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 teor):

 Replying to [comment:12 junglefowl]:
 > ...
 >
 > I did not adjust the code to accept SIZE_MAX. It will be impossible to
 load SIZE_MAX bytes into the address space, because even the used bytes in
 the stack make it impossible to succeed.

 There are some architectures where the size of individual objects is
 limited to SIZE_MAX, but the address space is larger than SIZE_MAX.
 Segmented architectures (where the stack and heap are in separate address
 spaces) are one example. So I don't think we can rely on the stack to save
 us from mapping SIZE_MAX.

 (Also, sometimes we use SIZE_T_CEILING to catch underflows - that might be
 what you want to do here.)

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21134#comment:14>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs