Operating Systems · UGC NET: Operating System Security and Protection
Protection and Access Matrix
Overview
Protection is the operating-system mechanism that controls which processes or users may access which resources, and in what way.
The access matrix is the classical abstract model that expresses these permissions, and the syllabus expects you to know both the model and the standard ways in which an OS actually implements it (global table, access-control lists, capability lists, lock-and-key).
This lesson sits in Operating System Security and Protection, so it is the bridge between the ideas of authentication/authorization and the concrete enforcement of access rights.
Before starting you should already know what a process is, what files and devices are as OS objects, and the difference between a user identity and a running process.
All definitions below follow the standard textbook treatment (Silberschatz, Galvin and Gagne, Operating System Concepts, protection chapter).
Key concepts
- Protection: an internal mechanism that controls access of processes and users to system resources such as files, memory segments, CPU, devices and semaphores.
Security is the wider goal of defending the system against attacks, both internal and external; protection is a mechanism that supports security. - Protection domain: a set of pairs (object, rights) that defines what a process may do. A process executes inside exactly one domain at a time.
A domain may coincide with a user (all processes of that user share it), a process, or a procedure. - Object (also called resource): any entity that can be accessed — file, directory, printer, tape drive, memory segment, semaphore, process, network socket.
- Right (access right): the permission in one matrix entry, for example read, write, execute, append, print, delete, wakeup, copy, owner, control, switch.
- Access matrix: a matrix whose rows are protection domains and whose columns are objects; the cell is the set of rights that domain holds on object . An empty cell means no access.
- Copy right: written with an asterisk, e.g. or read*. If contains , then domain may copy right on object into another domain's entry, either keeping the copy flag (copy) or dropping it (transfer).
- Owner right: the domain that owns an object may add and delete any right in that object's column, and may delete the object itself.
- Control right: a domain holding control over object may change the entries in the column of for other domains, but may not grant owner or control, and may not delete the object.
- Switch right: when the "object" in a cell is itself a domain, the right switch allows a process to move from domain into that domain. This is domain switching.
- Access-control list (ACL): the matrix stored column-wise — for each object, a list of (domain, rights) pairs.
- Capability: an unforgeable token (a "protected pointer") naming one object together with the rights on it. A capability list is the matrix stored row-wise — for each domain, a list of (object, rights) pairs.
- Global access table: the complete set of triples (domain, object, rights), one triple per non-empty cell.
- Lock-and-key: each object carries a list of bit patterns called locks; each domain holds a set of keys; access is allowed when the domain presents a key equal to one of the object's locks.
- Authentication, authorization and access control are three distinct steps: authentication verifies identity ("who are you?"), authorization is the process by which a user's privileges are ascertained (what the user is allowed to do), and access control is the mechanism that limits a user's access to the actual data or resources on the basis of those privileges.
- File locking: a synchronisation mechanism by which a locked file is denied to other users or processes, so a locked file is effectively accessible by only one user at a time; locking may be mandatory or advisory.
How it works
- Identify the domains and objects. List every protection domain (rows) and every object (columns). The matrix is rows by columns, so it has cells.
- Fill the entries. Put the exact set of rights in each non-empty cell and leave the rest empty. The matrix is normally very sparse, which is why real systems never store it as a plain two-dimensional array.
- Check an access request. A process running in domain asks for right on object . The kernel grants the request if and only if ; otherwise it raises a protection fault.
- Copy a right. If and copies the right to , then (with or without the asterisk, as chooses) is written into .
If the asterisk is kept, can copy further; if it is dropped, has the right but cannot pass it on. - Revoke a copied right. The owner deletes the copy flag from the entry where the chain started; every entry copied from it, transitively, must then lose the right.
Copies made by a domain that had only (no asterisk) are impossible, so the copied rights always form a tree rooted at the original entry. - Exercise the owner right. The owner of may write any right into any cell of column , may delete any cell of column , and may delete the object. It cannot be prevented by other domains.
- Exercise the control right. A domain with control on may modify other domains' entries in column , but may not grant owner or control to anybody (otherwise it could escalate its own power).
- Switch domains. If contains switch, a process in may enter ; after the switch its rights are those of .
User-controlled switching (a user starts a job in a chosen domain) and procedure-controlled switching (entering a procedure that runs in a new domain) are the two standard variants. - Choose an implementation. Resolve the abstract matrix into a global table, ACLs, capability lists or lock-and-key, depending on whether fast access checking, easy revocation, or small storage matters most.
Matrix view used in the examples below:
| Domain | O1 | O2 | D2 |
|---|---|---|---|
| D1 | read* | write | switch |
| D2 | read | — | — |
| D3 | — | read | — |
Drawing the diagram…
Drawing the diagram…
Formulas
- Number of matrix cells: , where is the number of protection domains (rows) and the number of objects (columns).
- Number of stored entries: , where is the access-control list of object and the capability list of domain . The same count is the number of triples in a global access table, because each non-empty cell is stored exactly once in every one of these three schemes.
- Density of the matrix: ; typical protection matrices have , which justifies storing only non-empty entries.
Worked examples
Example 1 (direct concept + numeric). An access matrix has 6 protection domains and 8 objects. How many rows, columns and cells?
Rows = domains = 6; columns = objects = 8; cells = . Each cell holds a set of rights, not a single letter, so 48 is the number of cells, not the number of rights.
Example 2 (copy right, two-step). ; all other entries for are empty. D1 copies read to D2 keeping the flag; D2 copies read to D3 keeping the flag; D3 copies read to D4 dropping the flag; D4 now tries to copy to D5.
- (copy, flag retained).
- (copy, flag retained).
- (limited copy, flag dropped).
- D4 has no asterisk, so the copy to D5 is illegal — stays empty.
Counts: four domains hold read (D1–D4); three domains can still copy (D1, D2, D3).
Revocation: the owner of deletes the copy flag from , which becomes . Because D2, D3 and D4 all descend from that entry, read is deleted from D2, D3 and D4. Final state: only D1 holds read, and nobody holds a copy right.
Example 3 (counting, two-step). An access matrix has 4 domains and 6 objects and is stored as ACLs, one per object, with non-empty entry counts 3, 2, 0, 4, 1, 2. How many triples does a global table hold, and what is the fourth domain's capability count if the first three domains have 5, 4 and 3 capabilities?
ACL entries: . A global table stores one triple per non-empty cell, so 12 triples. Capability lists also store exactly the non-empty cells, so the four domain counts must add to 12: . The fourth domain has an empty capability list (it can access nothing).
Example 4 (statement type). Statement I: An access-control list is associated with an object and stores the domains along with their rights. Statement II: A capability list makes it easy to revoke one right on one object from every holder at once.
Statement I is true — an ACL is the column of the matrix for one object. Statement II is false — revocation from all holders is exactly the weak point of capabilities, because the capabilities for an object are scattered across many domain lists. Answer: I true, II false.
Example 5 (match the list). Match A. Copy right, B. Owner right, C. Control right, D. Switch right with i. move the process into another domain, ii. grant or delete any right in an object's column and delete the object, iii. copy a right into another domain's entry with or without the flag, iv. change other domains' rights on a specific object without granting owner or control.
Copy right → iii; owner right → ii; control right → iv; switch right → i. The reasoning is positional: switch acts on a domain-column, owner on the whole column of an owned object, control on other entries of one column, copy on propagation of a single right.
Comparison
| Feature | Access-control list | Capability list |
|---|---|---|
| Matrix view | Column of the matrix (per object) | Row of the matrix (per domain) |
| Stored as | (domain, rights) pairs per object | (object, rights) pairs per domain |
| "Who may access this object?" | Easy, one list | Hard, scan all domains |
| "What may this domain access?" | Hard, scan all objects | Easy, one list |
| Revoking one right on one object from all holders | Easy, delete one entry | Difficult, must find every holder |
| Protection of the entries | List is kept by the kernel | Each capability must be unforgeable |
| Typical use | File systems, databases | Tagged architectures, microkernels, file descriptors |
| Term | Meaning in one line |
|---|---|
| Copy right | Holder may pass on, keeping or dropping the flag |
| Owner right | May change any entry of the object's column and delete the object |
| Control right | May change other domains' entries in that column only |
| Switch right | May change the executing domain itself |
| Term | Question it answers |
|---|---|
| Authentication | Who are you? |
| Authorization | What are you allowed to do? |
| Access control | Enforce that allowance on the actual data or resource |
| Scheme | Storage unit | Main advantage | Main drawback |
|---|---|---|---|
| Global table | Triple (domain, object, rights) | Simplest to understand | Table too large, no grouping |
| ACL | Per-object list | Easy revocation and easy audit per object | Slow "all objects of one domain" query |
| Capability list | Per-domain list | Fast check when opening an object | Hard revocation, forgery risk |
| Lock-and-key | Locks on object, keys in domain | Cheap comparison, no large lists | Key distribution and revocation |
Revision summary
- Row = domain, column = object, cell = set of rights;
that single sentence answers most direct questions. - Matrix size is ; number of stored triples equals total ACL entries equals total capability entries.
- The matrix is sparse, so only non-empty cells are stored in every practical scheme.
- Copy without asterisk = transfer; copy with asterisk = copy; the holder decides at copy time.
- A domain with but no asterisk can never copy — this stops runaway propagation.
- Revoking a copy right deletes all descendants of that entry, transitively.
- Only the owner may grant owner or control; a controller may not.
- ACL answers "who can touch this object"; capability answers "what can this domain touch".
- Capability revocation needs reacquisition, back-pointers, indirection or keys.
- Authorization ascertains privileges; access control enforces them on the data.
- A locked file is denied to other users, so it is accessible by only one user at a time.
- Storage schemes are mechanisms; the rights placed in the cells are policy.
Previous-year exam insights
- Direct definitional stems dominate: which does a row represent, which does a column represent, where the permissions of one object are stored, which scheme stores triples (domain, object, rights).
- Match List-I with List-II is common: global table, ACL, capability list, lock-and-key, and the four special rights (copy, owner, control, switch) are the usual items.
- Assertion and reason items almost always test the asymmetry between ACLs and capabilities — easy revocation with ACL, easy "what can this domain do" with capabilities, difficult global revocation of a capability.
- Numeric items ask for cells () or for stored entries, and often hide a two-step calculation: the ACL total fixes the capability total, so one missing count must be derived.
- Copy-right chains are asked as multi-step propagation; check the asterisk at every hop and remember that a domain without the asterisk cannot copy, and that revocation wipes the whole subtree.
- Statement-type items pair a true fact with a plausible but false one, for example "a capability list is associated with a domain" (true) against "capabilities make revocation easy" (false).
- Confusing words are the standard trap: authentication, authorization and access control; owner versus control right; protection versus security; copy versus transfer.
- Read the stem for the phrase "associated with" — object-linked means ACL, domain-linked means capability list.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- State what a row, a column and a cell of the access matrix stand for, without hesitating.
- Compute the number of cells from the number of domains and objects, and the number of stored entries from an ACL or capability count.
- Derive a missing capability count from a given ACL total, or the reverse.
- Trace a copy-right chain of four or five steps and state who holds the right, who can still copy, and what remains after revocation.
- Distinguish copy, owner, control and switch rights and say precisely what each one permits.
- Explain an ACL and a capability list in terms of the matrix, and give one advantage and one drawback of each.
- Explain three standard capability-revocation techniques and why revocation is hard without them.
- Answer assertion-reason and match-the-list items on this topic by first fixing the direction of the matrix.
- Separate authentication, authorization and access control in one sentence each.
- Decide, for a small system, whether an ACL or a capability list gives cheaper access checks and cheaper revocation.
Attempt the sub-topic test on Protection And Access Matrix first; after you clear it, take the full subject test on Operating System Security And Protection.