Privilege Modes and System Call Boundaries

Follow a controlled transition from application code into a kernel service and account for validation before returning to user mode.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A processor mode limits what code may do directly
  2. Protected execution still has to check caller inputs

A processor mode limits what code may do directly

An ordinary application executes with restricted hardware privileges and sees only mappings permitted by its address space. An operation such as opening a file needs kernel-managed state. A system call uses a defined entry mechanism that switches privilege and transfers control to a known kernel entry. The kernel derives the calling context from protected state rather than accepting an arbitrary application’s claim about its identity.

Protected execution still has to check caller inputs

The handler interprets arguments according to the system call contract and checks resource authority and any memory ranges it uses. It then returns a result or error through a defined interface. A timer or device interrupt can also enter privileged code but has a different initiating event. Virtual address translation enforces part of the boundary. Reference monitors explain the policy checks at mediated operations.[1]

References

  1. Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau, Operating Systems: Three Easy Pieces ↩