Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo insmod kutrace_mod.ko tracemb=20,general protection fault: 0000 [#1] SMP NOPTI #9

Open
SunnDay112 opened this issue Mar 24, 2024 · 1 comment

Comments

@SunnDay112
Copy link

os:unbuntu 16.04
kernel:4.19.19
question:
according to <<linux_patches_installation_guide.pdf>>,Building the modified kernel
do sudo insmod kutrace_mod.ko tracemb=20,install mod failed,memory dump.
how to fix this question?thankyou!

dmesg:
kutrace_trace hello =====================
[ 188.868457] vmalloc kutrace_pid_filter ffffb9a5018f5000
[ 188.868865] vmalloc kutrace_tracebase(20 MB) ffffb9a505739000 OK
[ 188.868866] mask 00000000ffffffff
[ 188.868866] mask 0000000000000000
[ 188.868866] mask 0000000000000000
[ 188.868867] == 00000000d1c517e5
[ 188.868867] IsIntel_64
[ 188.868867] debug 1
[ 188.868868] ku_setup_inst_retired 1
[ 188.868868] rdMSR 1
[ 188.868899] general protection fault: 0000 [#1] SMP NOPTI
[ 188.868904] CPU: 2 PID: 4093 Comm: insmod Tainted: G OE 4.19.19 #11
[ 188.868906] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[ 188.868910] RIP: 0010:ku_setup_inst_retired+0x29/0xf0 [kutrace_mod]

kutrace_module_error.txt

@xiongsiqiang
Copy link

If your environment is a virtual environment, check the virtual performance cpu counter, when kutrace.mod is loaded, the rdmsr will be used to read the MSR register, if the virtual performance CPU counter is not checked, the MSR register is not enabled in the virtual environment, and the rdmsr instruction reading the MSR register that is not turned on will trigger memory protection. PS: Instructions in the Intel Developer's Manual (EAX[3] enumerates support for XSAVES, XRSTORS, and the IA32_XSS MSR. If EAX[3] = 0, execution
of XSAVES or XRSTORS causes a #UD; an attempt to access the IA32_XSS MSR using RDMSR or
WRMSR causes a general-protection exception (#GP). Every processor that supports a supervisor state
component sets EAX[3]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants