Skip to content
Snippets Groups Projects

Fix altreloc remap, always NOP-fill padding bytes.

Merged Jacob Lorentzon requested to merge 4lDO2/kernel:altreloc_fix into master
  1. Apr 10, 2024
    • Jacob Lorentzon's avatar
      Fix altreloc remap, always NOP-fill padding bytes. · 3fc91038
      Jacob Lorentzon authored
      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.
      Verified
      3fc91038
Loading