How can I find out which registers are protected by the Linux kernel to keep user assembly from writing to them?
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.
Here is a list of registers that are only accessible from privilege level 0 (i.e., from the kernel):
CR0
- CR4
)GDTR
, LDTR
and IDTR
(Global/Local/Interrupt Descriptor Table Register)TR
(Task Register)DR0
- DR7
)MSR
s)You should read Chapter 5 of Intel's System Programming Manual for a detailed explanation on protection on the x86.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With