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?
Interrupt Privileges
Re:Interrupt Privileges
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.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Interrupt Privileges
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.
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.