How does Windows protect transition into kernel mode?

后端 未结 5 1723
梦如初夏
梦如初夏 2021-02-01 08:50

How does Windows protect against a user-mode thread from arbitrarily transitioning the CPU to kernel-mode?

I understand these things are true:

  1. User-mode th
5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 09:38

    I think (I may be wrong) that the mechanism which it uses for transition is simple:

    • User-mode code executes a software interrupt
    • This (interrupt) causes a branch to a location specified in the interrupt descriptor table (IDT)

    The thing that prevents user-mode code from usurping this is as follows: you need to be priviledged to write to the IDT; so only the kernel is able to specify what happens when an interrupt is executed.

提交回复
热议问题