将内核定位到高地址(存在bug,中断时会访问低地址)

This commit is contained in:
fslongjin
2022-04-10 21:30:16 +08:00
parent 3063a340e2
commit f5f36aafd8
23 changed files with 689 additions and 238 deletions

View File

@ -21,6 +21,7 @@ ul system_call_function(struct pt_regs *regs)
*/
void syscall_init()
{
kinfo("Initializing syscall...");
// 向MSR寄存器组中的 IA32_SYSENTER_CS寄存器写入内核的代码段的地址
wrmsr(0x174, KERNEL_CS);
// 向MSR寄存器组中的 IA32_SYSENTER_ESP寄存器写入内核进程的rbp在syscall入口中会将rsp减去相应的数值