How to get the address of a kernel module that was inserted using insmod?

前端 未结 2 2078
情歌与酒
情歌与酒 2020-12-18 02:01

I would like to know the address of a kernel module. Actually, from stack trace it looks that the crash has been triggered from a kernel module (which have been insmoded aft

相关标签:
2条回答
  • 2020-12-18 02:37

    /sys/module/<MODULE_NAME>/sections/ contains addresses of all sections of your module. Since most section begin with a dot (.), don't forget to pass -a to ls when listing this directory content:

    $ ls -a /sys/module/usbcore/sections/
    .                      __ex_table                 __param
    ..                     .fixup                     .rodata
    .altinstr_replacement  .gnu.linkonce.this_module  .rodata.str1.1
    .altinstructions       .init.text                 .rodata.str1.8
    .bss                   __kcrctab_gpl              .smp_locks
    __bug_table            __ksymtab_gpl              .strtab
    .data                  __ksymtab_strings          .symtab
    .data..read_mostly     __mcount_loc               .text
    .data.unlikely         .note.gnu.build-id         .text.unlikely
    .exit.text             .parainstructions          __verbose
    
    0 讨论(0)
  • 2020-12-18 03:01

    cat /proc/modules should give you a rough guide to where things are loaded. You might get more of a clue about exactly where the kernel crash is by looking at /proc/kallsyms.

    0 讨论(0)
提交回复
热议问题