Open weewoo22 opened 2 years ago
Nevermind what I posted earlier, I found the issue. Will push an update soon, but the module will most likely not work for you. Could you check if CONFIG_KALLSYMS
is enabled on your kernel?
$ zgrep CONFIG_KALLSYMS /proc/config.gz
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y
CONFIG_KALLSYMS_BASE_RELATIVE=y
Okay, kallsyms are definitely on, I've pushed an update to the kallsyms-mod submodule. It should now return correctly and print which symbol it failed to lookup. It could be failing either because the symbols for kvm_lock
and vm_list
are not exported for some reason, or because kvm
module is not loaded into the kernel.
On the former, I've noticed that my kernel has CONFIG_KALLSYMS_ALL
enabled (which I thought was off), so could be that. If this is a requirement, then it's bad from my end, I thought it wasn't needed, but having a kernel with this config on would fix it.
After restarting and inserting the updated kernel module it still fails to load in the same way as before:
[ 134.646119] do_init_module: 'memflow'->init suspiciously returned 9, it should follow 0/-E convention
do_init_module: loading module anyway...
[ 134.646123] CPU: 2 PID: 3368 Comm: insmod Tainted: G O 5.10.70 #1-NixOS
[ 134.646124] Call Trace:
[ 134.646130] dump_stack+0x6b/0x83
[ 134.646134] do_init_module.cold+0x21/0x26
[ 134.646136] __do_sys_finit_module+0xb1/0x110
[ 134.646139] do_syscall_64+0x33/0x40
[ 134.646140] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 134.646142] RIP: 0033:0x7fc4a31802a9
[ 134.646144] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 97 3b
0c 00 f7 d8 64 89 01 48
[ 134.646144] RSP: 002b:00007ffd872e53e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 134.646146] RAX: ffffffffffffffda RBX: 000000000188e7f0 RCX: 00007fc4a31802a9
[ 134.646146] RDX: 0000000000000000 RSI: 000000000041d288 RDI: 0000000000000003
[ 134.646147] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007fc4a3248060
[ 134.646148] R10: 0000000000000003 R11: 0000000000000246 R12: 000000000041d288
[ 134.646148] R13: 0000000000000000 R14: 000000000188e750 R15: 0000000000000000
Setting CONFIG_KALLSYMS_ALL=y
as you have for the kernel on your system allows the module to load successfully (memflow: initialized
)
It could be git submodules not being updated. Could you check that?
And it's good to know that CONFIG_KALLSYMS_ALL
is required, I will leave a note for now, but will look for a way around it for the future update.
After compiling and inserting the kernel module for my system it fails to initialize with:
Forcefully removing the kernel module with
modprobe -rf memflow
after load failure results in:I'm on kernel
5.10.70
as you can see indmesg