Closed geekjy closed 5 months ago
use khook_demo build,insmod crash
[ 96.808062] khook_demo: loading out-of-tree module taints kernel.
[ 96.808097] khook_demo: module verification failed: signature and/or required key missing - tainting kernel
[ 96.817377] BUG: stack guard page was hit at 0000000028c736c5 (stack is 00000000fb187494..00000000005575b1)
[ 96.817378] kernel stack overflow (double-fault): 0000 [#1] SMP NOPTI
[ 96.817379] CPU: 2 PID: 3992 Comm: bash Kdump: loaded Tainted: G OE -------- - - 4.18.0-552.el8.x86_64 #1
[ 96.817379] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[ 96.817379] RIP: 0010:khook_load_elf_binary+0x17/0x40 [khook_demo]
[ 96.817380] Code: 8b 44 24 70 48 89 44 24 28 48 8b 44 24 78 48 89 44 24 30 48 8b 84 24 80 00 00 00 48 89 44 24 38 48 b8 10 01 97 c0 ff ff ff ff
--------- - - 4.18.0-500.el8.x86_64 #1
[ 41.585865] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[ 41.585866] RIP: 0010:khook_load_elf_binary+0x17/0x40 [khook_demo]
[ 41.585866] Code: 8b 44 24 70 48 89 44 24 28 48 8b 44 24 78 48 89 44 24 30 48 8b 84 24 80 00 00 00 48 89 44 24 38 48 b8 10 81 b1 c0 ff ff ff ff
crash> bt PID: 4338 TASK: ffff88f77009c000 CPU: 2 COMMAND: "bash"
[exception RIP: khook_load_elf_binary+23]
RIP: ffffffffc0b18127 RSP: ffff968fc359c000 RFLAGS: 00010286
RAX: ffffffffc0b18110 RBX: ffff968fc359fd20 RCX: 0000000000000000
RDX: 0000000000000040 RSI: 0000000000000081 RDI: ffff88f7667acda0
RBP: fefefefefefefeff R8: 0000000000000000 R9: fefefefefefefeff
R10: 0000000000000fe0 R11: 0000000000000001 R12: ffff88f850b08020
R13: 2f2f2f2f2f2f2f2f R14: 0000000000000000 R15: 00000000000007ff
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
---
RIP: 00007f30ae9cab09 RSP: 00007ffea5ffdaa8 RFLAGS: 00000246
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f30ae9cab09
RDX: 00007ffea5ffdad0 RSI: 00007ffea5ffdad0 RDI: 000055ce26be0bcb
RBP: 000055ce2804bc90 R8: 0000000000000001 R9: 0000000000000000
R10: 0000000000000001 R11: 0000000000000246 R12: 000055ce281fc8a0
R13: 0000000000000024 R14: 00007ffea5ffdad0 R15: 000055ce2804bc90
ORIG_RAX: 0000000000000004 CS: 0033 SS: 002b
CentOS Stream release 9
5.14.0-402.el9.x86_64
works
CentOS Stream release 9 5.14.0-402.el9.x86_64
works
But CentOS Stream release 8 4.18.0-499.el8.x86_64-4.18.0-552.el8.x86_64 don't work.
Sorry, I found the reason, it's not a problem with the khook framework itself