next up previous contents
Next: Capability-Based System Boot Monitor Up: LinSec Capability Model Previous: Global Bounds   Contents


Capability Inheritance Algorithm

LinSec Capability Inheritance Algorithm is used to compute process capabilities and it builds on the algorithm existing in the Linux kernel, as part of the Process Capabilities support.

Capability Inheritance Algorithm implemented in Linux kernel has three steps (quoted from fs/exec.c where it is implemented):

      pI' = pI
(***) pP' = (fP & X) | (fI & pI)
      pE' = pP' & fE          [NB. fE is 0 or ~0]

I=Inheritable, P=Permitted, E=Effective // p=process, f=file
' indicates post-exec(), and X is the global 'cap_bset'.

As there is no support for executable file capabilities in existing Linux kernel, the variables in the algorithm corresponding to them are hardcoded as either maximal possible (for superuser processes) or as zero (for non superuser processes). This causes the resulting effective capability set to be either full capability set (for the superuser owned processes) or empty one (for non superuser owned processes).

The LinSec specific algorithm also has three steps and is an evolved version of the above, Linux implemented, algorithm:

  1. \(pI^\star = pI\)
  2. \(pP^\star = (fF \vert (fA \& (pI^\star \vert uP^\circ))) \& uB \& gB\)
  3. \(pE^\star = (pP^\star \& fE)\)

Where:

The first step of the LinSec algorithm is left unchanged (from the Linux implementation) as neither User Capabilities or Executable File Capabilities are designed to affect a process' inheritable capability set.

The second step has suffered most alterations. The thinking behind computing the new permitted (\(pP^\star\)) capability set is (starting by the innermost brackets):

The third step ensures that the process has, in its effective capability set, all capabilities needed by the newly executed binary to perform its task (fE) that it is allowed to have (logical AND with \(pP^\star\)).

The algorithm (Subsection 4.2.7) is triggered by two system events in LinSec capability model implementation:

In the former case, the algorithm is invoked to reflect capabilities of the new program that is being started while in the latter case, it is used to reflect capabilities of the new process owner.


next up previous contents
Next: Capability-Based System Boot Monitor Up: LinSec Capability Model Previous: Global Bounds   Contents