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

Kernel Panic and Symbol Export Issues on CentOS Stream 9 with Kernel 5.14.0-404.el9 #16

Closed
limstash opened this issue Jan 13, 2024 · 1 comment · Fixed by #17
Closed

Comments

@limstash
Copy link
Contributor

limstash commented Jan 13, 2024

Summary

Encountering a kernel panic related to write_syscall function and an unresolved symbol error for kallsyms_lookup_name on CentOS Stream 9 running kernel version 5.14.0-404.el9.x86_64.

Detailed

Kernel Panic on Write to sys_call_table

While attempting to modify the sys_call_table, a kernel panic occurs due to write protection, which seems to be related to the pinned sensitive bits in CR0 and CR4 as of kernel version 5.3 (referenced here).

The current method of modification triggers a permissions violation, resulting in a system crash. Below is the kernel log snippet capturing the panic:

[ 4632.359092] BUG: unable to handle page fault for address: ffffffff998017a0
[ 4632.359654] #PF: supervisor write access in kernel mode
[ 4632.360207] #PF: error_code(0x0003) - permissions violation
[ 4632.360756] PGD 2104015067 P4D 2104015067 PUD 2104016063 PMD 80000021034000e1 
[ 4632.361323] Oops: 0003 [#1] PREEMPT SMP PTI
[ 4632.361882] CPU: 24 PID: 10286 Comm: insmod Kdump: loaded Tainted: P        W  OE     -------  ---  5.14.0-404.el9.x86_64 #1
[ 4632.362476] Hardware name: Inspur IIMS/IIMS, BIOS 4.0.05 08/22/2018
[ 4632.363068] RIP: 0010:mpu_init_ioctl_hook+0x8b/0xc0 [mpu]
[ 4632.363657] Code: 4c 89 25 80 44 00 00 48 89 1d 81 44 00 00 48 89 05 82 44 00 00 0f 20 c5 48 89 ef 48 81 e7 ff ff fe ff e8 48 b0 7a d7 48 89 ef <48> c7 83 80 00 00 00 b0 80 09 c1 e8 35 b0 7a d7 31 c0 5b 5d 41 5c
[ 4632.364876] RSP: 0018:ffffac0e1a02bda8 EFLAGS: 00010286
[ 4632.365491] RAX: 0000000000000000 RBX: ffffffff99801720 RCX: 0000000000000027
[ 4632.366121] RDX: 0000000000000027 RSI: ffffffff9a467b00 RDI: 0000000080050033
[ 4632.366740] RBP: 0000000080050033 R08: 80000000ffff8c20 R09: ffffac0e1a02bd28
[ 4632.367366] R10: 0000000000000001 R11: 000000000000001b R12: ffff99514b03e268
[ 4632.367998] R13: ffffac0e1a02be68 R14: 0000000000000003 R15: 0000000000000000
[ 4632.368632] FS:  00007f4d7e170740(0000) GS:ffff99d13b500000(0000) knlGS:0000000000000000
[ 4632.369286] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4632.369940] CR2: ffffffff998017a0 CR3: 0000008164078003 CR4: 00000000007706e0
[ 4632.370604] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 4632.371271] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 4632.371937] PKRU: 55555554

Undefined Symbol kallsyms_lookup_name

Since kernel version 5.7, the kallsyms_lookup_name symbol is no longer exported, which is causing the module build process to fail with an undefined symbol error.

This issue has been previously mentioned in Issue #11 and PR #15 . The error log is as follows:

ERROR: modpost: "kallsyms_lookup_name" [/root/mpu/mpu.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:134: /root/mpu/Module.symvers] Error 1
make[2]: *** Deleting file '/root/mpu/Module.symvers'
make[1]: *** [Makefile:1841: modules] Error 2

Suggested Actions

Finally, in the above environment with Linux Container (Issue #12), nvidia-smi outputs the correct results.

@limstash
Copy link
Contributor Author

Container (LXC 4.0.12)

image

Host

image

@0of 0of closed this as completed in #17 Jan 14, 2024
0of pushed a commit that referenced this issue Jan 14, 2024
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

Successfully merging a pull request may close this issue.

1 participant