3

I had to do this for an assignment, so I figure I'll share my solution here. The base WSL2 kernel does not allow modules to be loaded. You have to compile and use your own kernel build. How to compile and use a kernel in WSL2: sudo git clone https://github.com/microsoft/WSL2-Linux-Kernel.git sudo apt install build-essential flex bison libssl-dev libelf-dev ...


2

module verification failed: signature and/or required key missing - tainting kernel This does not mean your module did not load. All it means is any kernel oops/panic messages will have a bit of information indicating that you have (or had at some point) an unsigned module loaded. This message is just a warning, not an error. (But if you try to submit a ...


1

You’re not initialising the kprobe structure in full, so you’re failing the exclusive or requirement between symbol_name and addr (point 3 in the table in the register_kprobe documentation): addr contains whatever is on the stack on function entry, which is likely to be non-zero, so both symbol_name and addr are non-zero and register_kprobe fails with EINVAL ...


1

The difference being (man nm) that flush_tlb_all is in the text section, where as sys_call_table is in the data section. However, both symbols are global (external). This is exactly why register_kprobe fails on sys_call_table: it only allows probes in the kernel text. kprobe_register calls check_kprobe_address_safe once it has the address to probe, and the ...


Only top voted, non community-wiki answers of a minimum length are eligible