Skip to content

Fix altreloc remap, always NOP-fill padding bytes.

Jacob Lorentzon requested to merge 4lDO2/kernel:altreloc_fix into master

This fixes a very rare (requires that an altreloc span two pages) kernel crash where it writes past the region that was remapped as RWX, thus triggering an in-kernel "wrote without write access" page fault.

Additionally, this fixes the logic for unavailable features. It fixes the short-circuit that would forget to remap the memory back from RWX to R-X. NOP bytes are also now replaced with multi-byte NOP regardless of whether the CPU supports the given feature.

Merge request reports