Open Kazurin-775 opened 2 years ago
Sorry that I forgot an important point: in order to trigger the oops, one has to actually make the kernel print the message stage1: finished
, e.g. by using:
echo 7 | sudo tee /proc/sys/kernel/printk
But this bug still cannot be reproduced on the kernel shipped with VMSH anyway.
On a VM booted up with Ubuntu 20.04 LTS cloud image, when the vmsh kernel library is unloaded from the guest address space, an unhandled page fault will happen in the guest kernel:
The fault address
0xffffffff800012e2
points tolibstage1.so
's code. The assembly reads as following:which corresponds to the function tail after the following statement: https://github.com/Mic92/vmsh/blob/cfbb612d5f5615b194fbacd9b4a32e9816eac3b4/src/stage1/src/lib.rs#L587-L588
It seems that the vmsh kernel library is unmapped before the stage1 kernel worker runs to completion, which should be a bug.
Commands to reproduce the error:
Logs: kernel-oops.log, vmsh.log