Page 1 of 1
Interrupt Privileges
Posted: Wed Feb 02, 2005 11:43 pm
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?
Re:Interrupt Privileges
Posted: Thu Feb 03, 2005 1:08 am
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.
Re:Interrupt Privileges
Posted: Thu Feb 03, 2005 3:45 am
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.
Re:Interrupt Privileges
Posted: Thu Feb 03, 2005 5:30 am
by QuiTeVexat
Alright. Thanks for the answers. I think it makes sense now.