哪些寄存器在Linux中受到用户空间的保护? [英] Which registers are protected from user space in linux?

查看:84
本文介绍了哪些寄存器在Linux中受到用户空间的保护?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何找出Linux内核保护了哪些寄存器,以防止用户程序集向它们写入数据?

How can I find out which registers are protected by the Linux kernel to keep user assembly from writing to them?

推荐答案

首先,请注意Linux内核本身并不真正保护寄存器.它所做的只是确保用户应用程序以3级特权(最低特权)运行.从这一点来看,是处理器对寄存器进行了强制保护.

First of all, note that the Linux kernel itself doesn't really protect registers. All it does is make sure user applications run with privilege level 3 (lowest privilege). From that point, it's the processor that enforces protection of registers.

这是只能从特权级别0(即,从内核)访问的寄存器列表:

Here is a list of registers that are only accessible from privilege level 0 (i.e., from the kernel):

  • 控制寄存器(CR0-CR4)
  • GDTRLDTRIDTR(全局/本地/中断描述符表寄存器)
  • TR(任务寄存器)
  • 调试寄存器(DR0-DR7)
  • 所有型号专用寄存器(MSR s)
  • Control registers (CR0 - CR4)
  • GDTR, LDTR and IDTR (Global/Local/Interrupt Descriptor Table Register)
  • TR (Task Register)
  • Debug registers (DR0 - DR7)
  • All Model Specific Registers (MSRs)

您应该阅读

You should read Chapter 5 of Intel's System Programming Manual for a detailed explanation on protection on the x86.

这篇关于哪些寄存器在Linux中受到用户空间的保护?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆