[Feature Request] linux-loader: ELF loader support for virtual KASLR · Issue #84 · rust-vmm/rust-vmm · GitHub
Skip to content

[Feature Request] linux-loader: ELF loader support for virtual KASLR  #84

Open

Description

@bencw12

rust-vmm/linux-loader#12 mentions that the kernel_offset argument to loader::elf::Elf::load() effectively does physical KASLR by allowing the kernel to be loaded at an offset from the default at CONFIG_PHYSICAL_START, but users do not have the option to use virtual KASLR when loading an ELF, and miss out on an additional layer of defense against code reuse attacks. KASLR is easily broken by information leaks, but since linux-loader is used in projects like Firecracker where VMs are short-lived, KASLR might be a desirable feature because VMs will be frequently re-randomized.

I was part of a group that published a paper at EuroSys'22 where we implemented KASLR in Firecracker (before it used linux-loader) with little boot time overhead (up to ~4ms for a large kernel config) and ~100 LoC. We also implemented Function Granular KASLR (FG-KASLR) which reduces the impact of an information leak by randomly reordering the functions in the kernel text, meaning that an info leak can only reveal the location of one function rather than the offset of the entire kernel. FG-KASLR has not been added to mainline Linux, but some early preparations for it have been merged upstream. FG-KASLR has much higher overhead than KASLR from our tests (~70ms added to overall boot time) and needs ~1K extra LoC.

FG-KASLR may be a less desirable feature than KASLR due to the overhead and extra code, but users who want KASLR in their VMs as another level of defense would have to resort to using a bzImage which eliminates the benefits of directly loading an ELF. Is support for virtual KASLR a desirable feature for this crate? If so, I'd be happy to provide an implementation.

Thanks!

Activity

  1. andreeaflorescu commented on Aug 17, 2026

    @andreeaflorescu
    Member

    @bencw12 I don't see any issue with offering this as an optional feature as long as there is kernel support for it.

    I see that in this issue firecracker-microvm/firecracker#5661 is mentioned that support will be added to Cloud Hypervisor. What is the progress on that?

  2. changed the title [-][Feature Request] ELF loader support for virtual KASLR [/-] [+][Feature Request] linux-loader: ELF loader support for virtual KASLR [/+] on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions