Trishansh Bhardwaj
Trishansh Bhardwaj

Reputation: 518

Can we disable aslr for linux kernel module (ko file)

Is there any way to disable ASLR for Linux kernel modules?

For example:

adb shell cat /proc/modules | grep module_name
module_name 8134656 27 - Live 0xffffffec11589000 (O)

Can we get the same address for all subsequent reboots?

Upvotes: 0

Views: 793

Answers (1)

Marco Bonelli
Marco Bonelli

Reputation: 69346

Not possible without disabling KASLR altogether. There is no special KASLR flag for modules, it's either enabled or disabled globally, modules included (as you can see from the source code). If CONFIG_RANDOMIZE_BASE=y then the kernel image address as well as module addresses will be randomized, and this can be disabled only by using the nokaslr kernel command line parameter at boot.

Upvotes: 2

Related Questions