x86 privilege introduce

1.Concept of privilege
     The concept of privilege is implemented by assigning a value from zero to three to key objects recognized by the processor.This value is called the privilege level.
     ● Descriptors contain a field called the descriptor privilege level(DPL).
     ● Selectors contain a field called the requestor's privilege level(RPL). The RPL is intended to represent the privilege level ofthe procedure that originates a selector.
     ● An internal processor register records the current privilege level(CPL).Normally the CPL is equal to the DPL of the segment thatthe processor is currently executing.CPL changes as control is transferred to segments with differing DPLs. 


2.Restricting access to Data
     Three different privilege levels enter into this type of privilege check:
     1)The CPL (current privilege level).
     2)The RPL (requestor's privilege level) of the selector used to specify the target segment.
     3)The DPL of the descriptor of the target segment.   
     Instructions may load a data-segment register only if the DPL of the target segment is numerically greaterthan or equal to the maximum of the CPL and the selector's RPL.   
     In other words, a procedure can only access data that is at the same or lessprivileged level.

    Level value: 0(kernel) & 3(application)  And   Privilege priority : kernel > application

猜你喜欢

转载自blog.csdn.net/jun_8018/article/details/87709699
今日推荐