How can I get the base address and size of a loaded kernel module?
Asked
Active
Viewed 1.0k times
2 Answers
4
I think you can use /proc/modules
. It contains information about all currently loaded modules in the kernel. For example:
cat /proc/modules | grep i8k
Result could be:
i8k 14696 0 - Live 0xffffffffa03b8000
Where:
- The first column contains the name of the module.
- The second column refers to the memory size of the module, in bytes.
- The third column lists how many instances of the module are currently loaded. A value of zero represents an unloaded module.
- The fourth column states if the module depends upon another module to be present in order to function, and lists those other modules.
- The fifth column lists what load state the module is in:
Live
,Loading
, orUnloading
. - Base memory address for a module in the kernel's virtual address space.
If you run:
awk '$1 ~ /i8k/ { print $1, $2, $6 }' /proc/modules
The result could be, values you need:
i8k 14696 0xffffffffa03b8000

taliezin
- 9,275
2
Size on /sys
I like this alternative as it gives just a single value:
cat /sys/module/<module-name>/coresize
Load address on pr_debug
If you enable pr_debug
, that information is present, and this can be useful if the module panics at init_module
.
Details at: How to get the address of a kernel module that was inserted using insmod? | Stack Overflow

Ciro Santilli OurBigBook.com
- 18,092
- 4
- 117
- 102
sudo cat /proc/modules
in order to see the base addresses (6) – philn Jun 09 '20 at 17:58