浏览代码

Kernel: Clear ESI and EDI on syscall entry

Since these are not part of the system call convention, we don't care
what userspace had in there. Might as well scrub it before entering
the kernel.

I would scrub EBP too, but that breaks the comfy kernel-thru-userspace
stack traces we currently get. It can be done with some effort.
Andreas Kling 5 年之前
父节点
当前提交
e576c9e952
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Kernel/Syscall.cpp

+ 2 - 0
Kernel/Syscall.cpp

@@ -48,6 +48,8 @@ asm(
     "    mov %ax, %ds\n"
     "    mov %ax, %es\n"
     "    cld\n"
+    "    xor %esi, %esi\n"
+    "    xor %edi, %edi\n"
     "    call syscall_handler\n"
     "    add $0x4, %esp\n"
     "    popl %gs\n"