Linux Credentials

Documentation: https://www.kernel.org/doc/html/latest/security/credentials.html


Mutating Credentials

Credentials are designed to be fast to access, so they use the high-performance RCU mechanism under the hood.

It is not permitted for a task to update the credentials of another task, and this assumption is also embodied in the “transactional” prepare/commit/abort API through which these updates are to be done:

prepare_creds() mutate resulting object commit_creds() abort_creds()  may error always  successful 

Objective and Subjective Credentials

The Linux credentials object carries information about the credentials of a process, such as the process UID, GID, capabilities, as well as Landlock domains.

struct task_struct ... real_cred cred ... struct creds

We distinguish between the objective and subjective credentials of a process:

The ways of access differ between the task that the credentials belong to and others: