RISC-V KASLR Support For Linux Revised Again

Written by Michael Larabel in RISC-V on 12 June 2023 at 11:52 AM EDT. Add A Comment
RISC-V
While the upstream Linux kernel support for RISC-V continues to improve with new ISA features, support for more RISC-V SoCs, and other enhancements, in some areas the open-source RISC-V code continues to play catch-up with the other mature architectures supported by the Linux kernel. One of the areas still pending is enabling KASLR support for RISC-V on Linux to enhance system security.

Kernel Address Space Layout Randomization (KASLR) is important for helping to prevent memory corruption vulnerabilities from being exploited. KASLR is very useful for fending off attacks relying upon an attacker knowing known memory address locations of the kernel by randomizing the kernel code at boot time.


KASLR on x86/x86_64 has been in mainline for about a decade and there's also been efforts to further enhance the randomization with the yet-to-be-finished FGKASLR. On the RISC-V side, KASLR support is still pending but this past week saw the third revision of the patches. The patches randomize the kernel mapping and relies on VMs having the bootloader provide a seed in the device tree or for physical RISC-V systems to have the firmware provide a randomized seed using the EFI RNG protocol.

With the v3 patches, the RISC-V KASLR code has been re-based against a newer Linux 6.4 state, there is a warning fix for RISC-V 32-bit, and other fixes. We'll see if this RISC-V KASLR support manages to be mainlined soon.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week