How can I find out which registers are protected by the Linux kernel to keep user assembly from writing to them?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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,LDTRandIDTR(Global/Local/Interrupt Descriptor Table Register)TR(Task Register)DR0–DR7)MSRs)You should read Chapter 5 of Intel’s System Programming Manual for a detailed explanation on protection on the x86.