1

I'm writing a simple kernel module and it seems on the newest kernel versions (I've tried 5.8, 5.10, 6.0) functions like kallsyms_lookup_name and kallsyms_on_each_symbol are no longer exported, meaning they can't be accessed through kallsyms.h. So, how do I access the list containing all the kernel symbols and their addresses from the kernel module? What's the best approach?

I'm able to find them with a shell command sudo cat /proc/kallsyms/ but now I wanna be able to do that from the k.o. Any suggestions?

2
  • grep KALLSYMS in your kernel .config file. If CONFIG_KALLSYMS and CONFIG_KALLSYMS_ALL are not set then set them and rebuild your kernel.
    – MC68020
    Commented Nov 1, 2022 at 14:15
  • @MC68020 that won’t help — as explained in the question, the symbol lookup functions aren’t accessible from kernel modules any more. See this comment for discussion, and the linked Q&A for some ideas of workarounds. Commented Nov 1, 2022 at 14:22

0

You must log in to answer this question.

Browse other questions tagged .