Interrupt Privileges

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
QuiTeVexat

Interrupt Privileges

Post by QuiTeVexat »

As I understand it, a interrupt descriptor's DPL will determine the CPL when the interrupt executes, and will also prevent code with a lower privilege level from doing a software interrupt to that interrupt routine.

If this is all true (which I suspect it can't be...), how can you call a higher privileged routine with an interrupt? What do I misunderstand?
AR

Re:Interrupt Privileges

Post by AR »

The IDT contains a Segment Selector, the CPL comes from the GDT Segment Descriptor referred to by the Selector. The IDT Descriptor's DPL is a seperate privilege field which specifies the lowest privilege level allowed to cause that interrupt.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Interrupt Privileges

Post by Pype.Clicker »

so let's say you're in some code running at PL=X (that is, CPL=X). If you issue INT 0x80, the system will check that IDT[0x80].DPL >= X

Then it will branch to newcode=IDT[0x80].Selector, which in turn will set the new CPL to Y=G/LDT[newcode].DPL another additionnal constraint (iirc) is that you may not have Y>X.
QuiTeVexat

Re:Interrupt Privileges

Post by QuiTeVexat »

Alright. Thanks for the answers. I think it makes sense now.
Post Reply