0

It used to be possible to call __vmalloc and pass in PAGE_KERNEL_EXEC to allocate executable space in older Linux kernels.

I'm using 5.15.55 and __vmalloc doesn't even take that parameter anymore, it takes one less.

How do I allocate executable space in LKM for newer kernel versions?

jafarlihi
  • 50
  • 1
  • 4
  • 15
  • 2
    module_alloc uses `__vmalloc_node_range` https://elixir.bootlin.com/linux/v5.18.12/source/kernel/module.c#L2835 – stark Jul 16 '22 at 20:28
  • @stark that'd be good to know if only `__vmalloc_node_range` was exported :') – Marco Bonelli Jul 18 '22 at 15:16
  • Seems like the only option you have left right now is `vmap()` (unless you want to [manually find and call non-exported functions](https://stackoverflow.com/questions/70930059/proper-way-of-getting-the-address-of-non-exported-kernel-symbols-in-a-linux-kern)). – Marco Bonelli Jul 18 '22 at 15:41

0 Answers0