xcellerator / linux_kernel_hacking

Linux Kernel Hacking
GNU General Public License v2.0
626 stars 123 forks source link

Add support for kernel version 5.7+ #5

Closed xcellerator closed 3 years ago

xcellerator commented 3 years ago

As of kernel 5.7, kallsyms_lookup_name() is no longer exported, so we have resolve the symbol manually. The method settled on is to use register a kprobe on kallsyms_lookup_name and save the address into an appropriately defined function pointer (thanks to @f0lg0 for the idea!).

Also included is some preprocessor logic in escape.c to use the proc_ops struct which replaces file_operatons in proc_create() as of kernel 5.6.