Page MenuHomeFreeBSD

Add an ldscript for amd64 kmods.
ClosedPublic

Authored by markj on Oct 10 2019, 4:07 PM.

Details

Summary

Provide padding for .text* and .rodata* so that memory protections may
be enforced.

This is not perfect: some linker sets are read-only and live in the same
page as writeable linker sets. For now I think it is reasonable to
simply live with this.

In the future it might be desireable to apply a heuristic to the .text
size of a KLD and instead pad to a 2MB boundary so that it gets mapped
with superpages. For instance, we might do this if the size of .text is
greater than 1MB, as it is for zfs.ko.

Diff Detail

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

Event Timeline

markj created this revision.Oct 10 2019, 4:07 PM
kib accepted this revision.Oct 10 2019, 4:26 PM
This revision is now accepted and ready to land.Oct 10 2019, 4:26 PM
This revision was automatically updated to reflect the committed changes.