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
F122440231: D20709.id58843.diff
Sat, Jul 5, 9:00 AM
Unknown Object (File)
Thu, Jun 19, 11:06 AM
Unknown Object (File)
Fri, Jun 13, 2:08 AM
Unknown Object (File)
Jun 4 2025, 4:57 AM
Unknown Object (File)
Jun 1 2025, 1:04 PM
Unknown Object (File)
May 24 2025, 11:28 PM
Unknown Object (File)
May 22 2025, 6:40 AM
Unknown Object (File)
May 22 2025, 6:21 AM
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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

brooks added inline comments.
share/man/man9/vm_map_protect.9
66

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

*worth noting

share/man/man9/vm_map_protect.9
66

Yeah - I'll confirm and commit another change.

share/man/man9/vm_map_protect.9
66

yes,

old_prot = current->protection;

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