Page MenuHomeFreeBSD

Clarify that vm_map_protect cannot upgrade max_protection
ClosedPublic

Authored by emaste on Jun 20 2019, 1:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 29 2024, 1:24 AM
Unknown Object (File)
Sep 15 2024, 8:43 PM
Unknown Object (File)
Sep 12 2024, 10:38 PM
Unknown Object (File)
Sep 8 2024, 3:54 PM
Unknown Object (File)
Sep 4 2024, 12:13 PM
Unknown Object (File)
Sep 2 2024, 1:26 PM
Unknown Object (File)
Sep 2 2024, 1:26 PM
Unknown Object (File)
Sep 2 2024, 1:26 PM
Subscribers

Details

Summary

It's implied by the RETURN VALUES section but be explicit in the description that vm_map_protect can not set new protection bits that are already in each entry's max_protection.

(Prompted by a comment/review in D18880.)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks added inline comments.
share/man/man9/vm_map_protect.9
66 ↗(On Diff #58833)

It is probably noting that this case also (IIRC) demotes any existing permissions (vs bailing if they would not be permitted).

This revision is now accepted and ready to land.Jun 20 2019, 6:04 PM
share/man/man9/vm_map_protect.9
66 ↗(On Diff #58833)

*worth noting

share/man/man9/vm_map_protect.9
66 ↗(On Diff #58833)

Yeah - I'll confirm and commit another change.

share/man/man9/vm_map_protect.9
66 ↗(On Diff #58833)

yes,

old_prot = current->protection;

if (set_max)
        current->protection =
            (current->max_protection = new_prot) &
            old_prot;
else
        current->protection = new_prot;