Page MenuHomeFreeBSD

Set permissions appropriately on preloaded DSOs.

Authored by markj on Oct 1 2019, 7:11 PM.



Now that we map preloaded data with NX by default on amd64, the kernel
linker must upgrade protections to allow execution of preloaded kernel
modules. Upgrade to VM_PROT_ALL when applying relocations, then use the
permissions requested by the loadable segment descriptors.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj created this revision.Oct 1 2019, 7:11 PM
markj added reviewers: alc, kib.Oct 1 2019, 7:35 PM
markj updated this revision to Diff 62849.Oct 2 2019, 6:02 PM
  • We need to upgrade protections on preloaded .o files as well.
kib accepted this revision.Oct 2 2019, 7:15 PM
This revision is now accepted and ready to land.Oct 2 2019, 7:15 PM
markj updated this revision to Diff 62904.Oct 4 2019, 4:14 PM

Rebase on top of D21896.

This revision now requires review to proceed.Oct 4 2019, 4:14 PM
markj updated this revision to Diff 62918.Oct 4 2019, 7:31 PM

Stop checking for errors from pmap_change_prot(). In this usage, it
can only fail if we fail to allocate a page during demotion. However,
we only use pmap_change_prot() to set protections for preloaded modules,
and this happens early during boot, so a page shortage should not be

This revision was not accepted when it landed; it landed in state Needs Review.Oct 18 2019, 1:57 PM
This revision was automatically updated to reflect the committed changes.