Drawing the Red Line in Java

Godmar Back and Wilson Hsieh (Utah), 1999

Summary. The presence of type-safety in systems based on type-safe languages has been erroneously coupled with an absence of a user/kernel boundary. Yet it is this user/kernel boundary which enables resource control, safe termination and safe interprocess communication. Although type-safety adequately fills the role of hardware in providing protection, without the red line, these other three services cannot be guaranteed.

In hw-based systems, the hw protection facilitates the creation of a kernel/user red-line; the authors show how to create such a red-line in a java system and explain why it is necessary.


More detail

Traditional systems create a red line between user and kernel space. Kernel space is entered and exited via hardware traps; kernel code is carefully written and monitored and is, therefore, trusted to neither harm itself nor other processes in a malicious manner. This trusted kernel code enforces the policies for resource control, safe termination and safe interprocess communication.

In a system based on type-safe language, this red-line doesn't exist. The authors claim that with no red line, however, a system cannot ensure resource control, safe termination, or safe interprocess communication. Below are reasons why such services should be provided and how the authors created a red-line to provide such services in their KaffeOS system. The general recipe is:

  1. Create the red line by separating Java code into user and kernel code. Kernel entry/exit implemented as function calls (language support to enable the compiler to automatically generate kernel entry/exit code being considered).
  2. Create mechanisms to protect kernel code from terminating. A thread entering kernel code defers termination requests. Kernel code is trusted (empirically ensured) not to throw exceptions.

Resource control.

Safe termination. Safe interprocess communication.