AccessCheck Overview

AccessCheck is the function that connects tokens to security descriptors. Given a token — who is asking — a descriptor — what the rules are — and a desired access mask — what they want to do — it returns a verdict: which of the requested rights are granted, and whether the request as a whole succeeds.

It is a pipeline, evaluating several layers of policy in a fixed order. Each layer can grant or constrain access and the layers interact: integrity policy can block what the DACL would allow, privileges can override what the DACL denied, and confinement can revoke what privileges granted. The order is not incidental — it is the specification.

Two API variants #

AccessCheck is the common case. It returns the granted access mask, whether the request succeeded, a continuous audit mask derived from SACL alarm ACEs, and a CAAP staging mismatch flag. When an object type list is supplied, success requires every listed node to pass and the returned mask is the intersection across them. The staging mismatch flag is set when the staged scalar result differs from the effective scalar result, when any per-node staged grant differs from the effective per-node grant, or when staged auditing differs from effective auditing.

AccessCheckResultList is the per-property variant and requires an object type list. It returns a separate verdict for each node, so a denial on one property fails that property alone rather than the whole request. It returns the same continuous audit mask and staging mismatch flag, with the flag set when the staged scalar result differs from the effective one, when any node's staged granted mask differs from that node's effective granted mask, or when staged auditing differs from effective auditing — the scalar comparison is not mode-branched. Directory services use it, because one operation there may touch several properties with independent access rules. Privilege-use auditing in this variant takes the same per-node view: a privilege counts as successfully used if its contributed bits survive on any node's final granted mask.

Both variants share one evaluation pipeline. Only the collection of results differs.

A supplied subject without a token #

The separate kacs_access_check_subject query evaluates caller-supplied SID, group and typed-claim facts without creating, adopting or impersonating a token. It reuses the DACL, conditional and object-ACE evaluators. Omitted facts stay unknown; known-empty collections and explicit claim absences are distinct. No access fact is inherited from the caller. Explicit integrity, trust, scoped-policy and privilege requirements return missing execution context rather than acquiring the caller's authority.

Syscall 1028 accepts a versioned request buffer and writes a granted, denied or missing-context result. Missing context carries no provisional grant. The kernel copies and validates one bounded buffer; internal offsets replace nested userspace pointers. The UAPI access header specifies layout and limits. Malformed or excessive inputs fail the entire query without truncating facts.

Matching SACL audit ACEs require enabled SeAuditPrivilege on the actual caller. KACS_SUBJECT_NO_AUDIT suppresses this query's records; it does not bypass mandatory SACL labels. Audit-only missing facts matter only while auditing is active. Records use kacs.audit.subject.checked: subject is the real caller and source.supplied-subject.sid is a hypothetical assertion. An optional generic AuditContext labels the guarded object without influencing policy. Detected audit preparation or submission errors fail the query. Records are submitted before result writeback, so a bad output pointer cannot silence requested auditing.

The three state values #

Every access check tracks three masks.

decided records which bits have been resolved. It enforces first-writer-wins within the DACL walk: once a bit is decided, no later ACE in the same walk changes its outcome. Pipeline layers that operate on top of the DACL result — restricted token intersection, confinement intersection, PIP revocation, CAAP intersection — may still revoke granted bits. Those layers narrow the result; they do not re-open decided bits for re-evaluation through the DACL.

granted records which bits resolved to yes. During the walk it is a subset of decided. Afterwards the later layers may remove bits from it, and the final value is what the caller receives.

privilege_granted records which bits in granted came from a privilege rather than from the DACL. It exists for two reasons: audit accuracy, so that privilege-granted access is distinguishable from DACL-granted access, and the restricted token merge, where privilege-granted bits are restored after the intersection so that privileges bypass the restricted pass. PIP may revoke privilege-granted bits.

With an object type list present, each node carries its own decided and granted pair.

Edit this page