[tor-bugs] #25399 [Core Tor/Tor]: mmap length doesn't need to be page-aligned
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Mar 22 01:00:33 UTC 2018
#25399: mmap length doesn't need to be page-aligned
-----------------------------+------------------------------------
Reporter: Hello71 | Owner: (none)
Type: defect | Status: merge_ready
Priority: Low | Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor | Version:
Severity: Minor | Resolution:
Keywords: review-group-34 | Actual Points:
Parent ID: | Points: 0.5
Reviewer: ahf | Sponsor:
-----------------------------+------------------------------------
Changes (by ahf):
* status: needs_review => merge_ready
Comment:
As far as I can tell this looks good. Even the man pages mentions that
`getpagesize()` is deprecated and `sysconf(_SC_PAGESIZE)` should be used
instead.
The interesting part from POSIX:
{{{
The off argument is constrained to be aligned and sized according to the
value
returned by sysconf() when passed _SC_PAGESIZE or _SC_PAGE_SIZE. When
MAP_FIXED
is specified, the argument addr must also meet these constraints. The
implementation performs mapping operations over whole pages. Thus, while
the
argument len need not meet a size or alignment constraint, the
implementation
will include, in any mapping operation, any partial page specified by the
range
[pa, pa + len).
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25399#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list