Page MenuHomeFreeBSD

mprotect.2: Remove legacy BSD text
ClosedPublic

Authored by brooks on Sep 1 2021, 9:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 18, 6:19 AM
Unknown Object (File)
Mon, Mar 18, 6:19 AM
Unknown Object (File)
Fri, Mar 15, 10:51 PM
Unknown Object (File)
Fri, Mar 15, 10:40 PM
Unknown Object (File)
Feb 27 2024, 11:18 PM
Unknown Object (File)
Jan 28 2024, 11:21 AM
Unknown Object (File)
Jan 1 2024, 6:09 AM
Unknown Object (File)
Jan 1 2024, 6:08 AM
Subscribers

Details

Summary

This text dates to the BSD 4.4 import and is misleading. The mprotect
syscall acts on page granularity and breaks up mappings as required to
do so.

Note that with the addition of non-transparent superpages (aka
largepages) the size of a page at a given address may vary. This
commit does not attempt to address the lack of documentation of this
feature.

Sponsored by: DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks requested review of this revision.Sep 1 2021, 9:28 PM
This revision is now accepted and ready to land.Sep 1 2021, 9:31 PM

Per the discussion in D30442 this removes the incorrect description of mprotect granularity. Documentation of large pages is left for later.

Ultimately, I think that the text will have to grow a new paragraph: (1) mentioning the possible existence of large page sizes on some architectures (See getpagesizes()); (2) that if the specified range does not cover an entire large page, the system will either demote the page mapping to a sufficiently small size or return an error, depending on whether the large page was created automatically or explicitly via shm_open(). In particular, I see no way of describing this without introducing the notion of demotion.

This revision was automatically updated to reflect the committed changes.