Need memory address where the kernel module (*.ko) will be loaded, so I can break-into the system when the address is accessed.
Seems plenty of posts suggesting how to get it after the fact, from /proc/modules for example. This is great, but this is after the fact.
Even loading, unloading the module during runtime does not guarantee it will be loaded always at the same address. If there way to fix it ? I hoped insmod has an address parameter, but seems I was wrong.
.ko
file, so you cannot get that address without loading the module. – Tsyvarevmodule_alloc
, so an attempt to guess its result is like guessing result of the malloc. BTW, if you just want to call some kernel function when the load address of the module becomes known but before the module is loaded,register_module_notifier
is your friend. – Tsyvarev