On x86, when a preloaded kernel module is unloaded, we free the backing
(physically contiguous) pages. The ET_REL linker will have adjusted
protections on segments of the preloaded file, which updates the direct
map, so the original protections must be restored when unloading the
module.
Previously this was handled in kmem_bootstrap_free(), but I see no
reason not to handle this within the kernel linker. Moreover, we were
not resetting permissions in the kernel map on arm64.