Winter Semester 2026–27 · VIT-AP · BACSE106 · Operating Systems · Dr. Krithika L.B

Session 5.4: Protection: domains of protection, access matrix and capability-based systems

Least privilege, protection domains and domain switching (setuid, MULTICS rings), the access matrix and its rights, and implementing it with access lists, capability lists and lock–key schemes.

Module 5 1.5 hours Theory CO5
← Before
5.3 Threats & crypto
Security
You are here
5.4 Protection: domains of protection, access matrix and capability-based systems
Module 5 · Managing Devices, Security, Protection and Virtualization
Next →
5.5 Virtual machines
Hypervisors

Learning objectives

By the end of this session you should be able to:

  • State the goals of protection, the principle of least privilege and need-to-know.
  • Define a protection domain and explain static and dynamic domain association.
  • Read and extend an access matrix with switch, copy, owner and control rights.
  • Compare global tables, access lists, capability lists and lock–key implementations.
  • Describe revocation and capability-based systems, including Linux capabilities.

Lecture notes

1. Goals and principles of protection

Protection is the set of mechanisms that control the access of processes and users to the resources of a computer system. It prevents malicious or mistaken misuse, and it limits the damage a faulty component can do. Two guiding principles:

Principle of least privilege

Give programs, users and systems just enough privilege to perform their tasks — like a hotel key card that opens only your room and only for your stay. A bug or attack then does limited damage.

Need-to-know

At any time a process should be able to access only those resources it currently needs to complete its task.

Remember the policy–mechanism separation of Session 1.4: protection provides mechanisms; who may access what is a policy set by designers, administrators and users.

2. Domains of protection

A computer system is a collection of processes and objects — hardware objects (CPU, memory, printers, disks) and software objects (files, programs, semaphores). Each object has a unique name and a set of operations.

Domain

A protection domain is a set of access rights, each an ordered pair <object-name, rights-set>, e.g. <file F, {read, write}>. A process executes within a domain; domains may share rights. The association between a process and a domain can be static (fixed for the process's life) or dynamic (the process can switch domains).

D1: <O3, {read, write}> <O1, {read, write}> <O2, {execute}> D2: <O2, {write}> <O4, {print}> D3: <O1, {execute}> <O3, {read}>

Domains may overlap: here O2 appears in D1 and D2 with different rights.

Domain = user

UNIX: objects accessible depend on the user ID; switching domain = changing user (e.g. login, su).

Domain = process

Each process is a domain; switching = sending a message to another process.

Domain = procedure

Each procedure's local variables form a domain; switching happens on a procedure call.

Domain switching in UNIX: setuid

The passwd program must write /etc/shadow, which ordinary users cannot touch. Its file has the setuid bit: when executed, the process temporarily runs with the owner's (root's) user ID — a controlled domain switch.

Terminal
$ ls -l /usr/bin/passwd /etc/shadow
-rwsr-xr-x 1 root root   59976 Feb  6 /usr/bin/passwd    # 's' = setuid
-rw-r----- 1 root shadow  1532 Mar 12 /etc/shadow

MULTICS organised domains as concentric rings 0…7: ring 0 (kernel) has the most privileges; a process in ring i can access ring j ≥ i freely, and must use a controlled gate to call into an inner ring. The x86 rings of Session 1.3 descend from this idea.

3. The access matrix

Protection can be modelled abstractly as a matrix: rows = domains, columns = objects, and entry access(i, j) = the set of operations a process in domain Di may invoke on object Oj.

domain \ objectF1F2F3printer
D1readread
D2print
D3readexecute
D4read, writeread, write

A process in D4 may read and write F1 and F3; a process in D2 may only print. The matrix separates mechanism (the OS checks every access against it) from policy (who fills in the entries).

Extending the matrix: controlled change

switch

Domains as columns too: switch ∈ access(i, j) lets a process move from Di to Dj.

copy ( * )

read* in a column lets the holder copy “read” to another domain in the same column — transfer (the original loses it) or limited copy (without the *).

owner

The owner of an object can add or remove any right in that object's column.

control

control ∈ access(i, j) (j a domain) lets Di remove rights from Dj's row.

4. Implementing the access matrix

The matrix is large and sparse, so it is never stored directly.

A list of triples <domain, object, rights-set>. Simple, but the table is huge (cannot stay in memory) and grouping is hard — a file readable by everyone needs an entry for every domain.

Store each column with its object: object → list of <domain, rights>. Extend with a default set. This is how files are protected: UNIX rwx bits (owner/group/others) are a compressed access list; Windows and Linux ACLs are full lists.

F1: [ D1: read · D4: read, write ]

Store each row with its domain: domain → list of <object, rights> called capabilities. Possessing the capability is proof of the right to access. Capabilities must be protected — kept by the kernel or tagged in hardware — so a process cannot forge them.

D4: [ F1: read, write · F3: read, write ]

A compromise: each object has a list of locks, each domain a list of keys; access is allowed if a key matches a lock. Keys can be passed between domains; revoking = changing a lock.

Real systems combine them: the access list is checked once at open(), which then returns a capability — the file descriptor (Session 4.7) — used for every later read/write without re-checking.

Access list (column)Capability list (row)
Answers easily“Who can access this object?”“What can this domain access?”
Check costSearch the list on every accessJust present the capability
RevocationEasy — edit the listHard — capabilities are scattered
ExamplesUNIX rwx, ACLsFile descriptors, Hydra, CAP, Linux capabilities

5. Revocation and capability-based systems

Revoking access may need to be immediate or delayed, selective or general, partial or total, temporary or permanent. With access lists it is easy; with capabilities the options are reacquisition, back-pointers, indirection through a global table, or keys that can be changed.

Hydra

A capability-based OS (CMU) with a fixed set of rights plus user-defined rights interpreted by subsystems, and rights amplification for trusted procedures.

Cambridge CAP

Hardware-supported data capabilities and software capabilities interpreted by protected procedures.

Linux capabilities

Root's all-powerful privilege is split into ~40 capabilities (CAP_NET_BIND_SERVICE, CAP_SYS_TIME…) so a program gets only what it needs — least privilege in practice. Try getcap /usr/bin/ping.

VideoBytes

Domains of protection

Video coming soon

Domains of protection

Recorded by Dr. Krithika L.B. Slot m5-domains

Access matrix and capabilities

Video coming soon

Access matrix and capabilities

Recorded by Dr. Krithika L.B. Slot m5-access-matrix

Interactive lessons

Work through these in order after the lecture — each one expands a part of the notes with diagrams, hover notes and a quick check.

Lab connection

Check your understanding

Answer each question in your own words first, then reveal the model answer.

Revealed 0
Using the matrix above, can a process in D3 write F2?

No — D3 has only read on F2.

Which implementation stores the matrix by columns?

Access lists (one list per object).

Why is revocation harder with capabilities than with access lists?

Capabilities are distributed among many domains; they must all be found and invalidated, whereas an access list is in one place.

What does the setuid bit on /usr/bin/passwd achieve?

It lets an ordinary user's process temporarily run with root's privileges to update /etc/shadow — a controlled domain switch.

What does read* mean in an access-matrix entry?

The domain has read and may copy the read right to other domains (in that object's column).

Key takeaways

  • Protection = mechanisms controlling access; guided by least privilege and need-to-know.
  • A domain is a set of <object, rights>; switching via setuid or rings.
  • Access matrix: rows domains, columns objects; stored as access lists (columns) or capability lists (rows), or lock–key.

Where this leads

Protection isolates processes within one OS. Virtualization goes further: it isolates whole operating systems from each other on one machine.

Continue to 5.5 — Virtual machines and hypervisors →