Chapter 13: Protection: Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials - 8 Edition
Chapter 13: Protection: Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials - 8 Edition
Operating System Concepts Essentials– 8th Edition Silberschatz, Galvin and Gagne ©2011
Chapter 13: Protection
Goals of Protection
Principles of Protection
Domain of Protection
Access Matrix
Implementation of Access Matrix
Access Control
Revocation of Access Rights
Capability-Based Systems
Language-Based Protection
Operating System Concepts Essentials – 8th Edition 13.2 Silberschatz, Galvin and Gagne ©2011
Objectives
Discuss the goals and principles of protection in a modern computer system
Explain how protection domains combined with an access matrix are used to specify the resources a
process may access
Operating System Concepts Essentials – 8th Edition 13.3 Silberschatz, Galvin and Gagne ©2011
Goals of Protection
In one protection model, computer consists of a collection of objects, hardware or software
Each object has a unique name and can be accessed through a well-defined set of operations
Protection problem - ensure that each object is accessed correctly and only by those processes that are
allowed to do so
Operating System Concepts Essentials – 8th Edition 13.4 Silberschatz, Galvin and Gagne ©2011
Principles of Protection
Guiding principle – principle of least privilege
z Programs, users and systems should be given just enough privileges to perform their tasks
z Limits damage if entity has a bug, gets abused
z Can be static (during life of system, during life of process)
z Or dynamic (changed by process as needed) – domain switching, privilege escalation
z “Need to know” a similar concept regarding access to data
Operating System Concepts Essentials – 8th Edition 13.5 Silberschatz, Galvin and Gagne ©2011
Domain Structure
Access-right = <object-name, rights-set>
where rights-set is a subset of all valid operations that can be performed on the object
Operating System Concepts Essentials – 8th Edition 13.6 Silberschatz, Galvin and Gagne ©2011
Domain Implementation (UNIX)
Domain = user-id
Operating System Concepts Essentials – 8th Edition 13.7 Silberschatz, Galvin and Gagne ©2011
Domain Implementation (MULTICS)
Operating System Concepts Essentials – 8th Edition 13.8 Silberschatz, Galvin and Gagne ©2011
Multics Benefits and Limits
Ring / hierarchical structure provided more than the basic kernel / user or root / normal user design
Operating System Concepts Essentials – 8th Edition 13.9 Silberschatz, Galvin and Gagne ©2011
Access Matrix
View protection as a matrix (access matrix)
Access(i, j) is the set of operations that a process executing in Domaini can invoke on Objectj
Operating System Concepts Essentials – 8th Edition 13.10 Silberschatz, Galvin and Gagne ©2011
Access Matrix
Operating System Concepts Essentials – 8th Edition 13.11 Silberschatz, Galvin and Gagne ©2011
Use of Access Matrix
If a process in Domain Di tries to do “op” on object Oj, then “op” must be in the access matrix
User who creates object can define access column for that object
Operating System Concepts Essentials – 8th Edition 13.12 Silberschatz, Galvin and Gagne ©2011
Use of Access Matrix (Cont.)
Access matrix design separates mechanism from policy
z Mechanism
Operating system provides access-matrix + rules
If ensures that the matrix is only manipulated by authorized agents and that rules are strictly
enforced
z Policy
User dictates policy
Who can access what object and in what mode
Operating System Concepts Essentials – 8th Edition 13.13 Silberschatz, Galvin and Gagne ©2011
Access Matrix of Figure A
with Domains as Objects
Operating System Concepts Essentials – 8th Edition 13.14 Silberschatz, Galvin and Gagne ©2011
Access Matrix with Copy Rights
Operating System Concepts Essentials – 8th Edition 13.15 Silberschatz, Galvin and Gagne ©2011
Access Matrix With Owner Rights
Operating System Concepts Essentials – 8th Edition 13.16 Silberschatz, Galvin and Gagne ©2011
Modified Access Matrix of Figure B
Operating System Concepts Essentials – 8th Edition 13.17 Silberschatz, Galvin and Gagne ©2011
Implementation of Access Matrix
Generally, a sparse matrix
Option 1 – Global table
z Store ordered triples < domain, object, rights-set > in table
z A requested operation M on object Oj within domain Di -> search table for < Di, Oj, Rk >
with M אRk
Operating System Concepts Essentials – 8th Edition 13.18 Silberschatz, Galvin and Gagne ©2011
Each column = Access-control list for one object
Defines who can perform what operation
Operating System Concepts Essentials – 8th Edition 13.19 Silberschatz, Galvin and Gagne ©2011
Implementation of Access Matrix (Cont.)
Option 3 – Capability list for domains
z Instead of object-based, list is domain based
z Capability list for domain is list of objects together with operations allows on them
z Object represented by its name or address, called a capability
z Execute operation M on object Oj, process requests operation and specifies capability as parameter
Possession of capability means access is allowed
z Capability list associated with domain but never directly accessible by domain
Rather, protected object, maintained by OS and accessed indirectly
Like a “secure pointer”
Idea can be extended up to applications
Option 4 – Lock-key
z Compromise between access lists and capability lists
z Each object has list of unique bit patterns, called locks
z Each domain as list of unique bit patterns called keys
z Process in a domain can only access object if domain has key that matches one of the locks
Operating System Concepts Essentials – 8th Edition 13.20 Silberschatz, Galvin and Gagne ©2011
Comparison of Implementations
Many trade-offs to consider
z Global table is simple, but can be large
z Access lists correspond to needs of users
Determining set of access rights for domain non-localized so difficult
Every access to an object must be checked
– Many objects and access rights -> slow
z Capability lists useful for localizing information for a given process
But revocation capabilities can be inefficient
z Lock-key effective and flexible, keys can be passed freely from domain to domain, easy revocation
Operating System Concepts Essentials – 8th Edition 13.21 Silberschatz, Galvin and Gagne ©2011
Access Control
Protection can be applied to non-file resources
Operating System Concepts Essentials – 8th Edition 13.22 Silberschatz, Galvin and Gagne ©2011
Role-based Access Control in Solaris 10
Operating System Concepts Essentials – 8th Edition 13.23 Silberschatz, Galvin and Gagne ©2011
Revocation of Access Rights
Various options to remove the access right of a domain to an object
z Immediate vs. delayed
z Selective vs. general
z Partial vs. total
z Temporary vs. permanent
Access List – Delete access rights from access list
z Simple – search access list and remove entry
z Immediate, general or selective, total or partial, permanent or temporary
Capability List – Scheme required to locate capability in the system before capability can be revoked
z Reacquisition – periodic delete, with require and denial if revoked
z Back-pointers – set of pointers from each object to all capabilities of that object (Multics)
z Indirection – capability points to global table entry which points to object – delete entry from global
table, not selective (CAL)
z Keys – unique bits associated with capability, generated when capability created
Master key associated with object, key matches master key for access
Revocation – create new master key
Policy decision of who can create and modify keys – object owner or others?
Operating System Concepts Essentials – 8th Edition 13.24 Silberschatz, Galvin and Gagne ©2011
Capability-Based Systems
Hydra
z Fixed set of access rights known to and interpreted by the system
i.e. read, write, or execute each memory segment
User can declare other auxiliary rights and register those with protection system
Accessing process must hold capability and know name of operation
Rights amplification allowed by trustworthy procedures for a specific type
z Interpretation of user-defined rights performed solely by user's program; system provides access
protection for use of these rights
z Operations on objects defined procedurally – procedures are objects accessed indirectly by
capabilities
z Solves the problem of mutually suspicious subsystems
z Includes library of prewritten security routines
Cambridge CAP System
z Simpler but powerful
z Data capability - provides standard read, write, execute of individual storage segments
associated with object – implemented in microcode
z Software capability -interpretation left to the subsystem, through its protected procedures
Only has access to its own subsystem
Programmers must learn principles and techniques of protection
Operating System Concepts Essentials – 8th Edition 13.25 Silberschatz, Galvin and Gagne ©2011
Language-Based Protection
Specification of protection in a programming language allows the high-level description of policies for the
allocation and use of resources
Language implementation can provide software for protection enforcement when automatic hardware-
supported checking is unavailable
Interpret protection specifications to generate calls on whatever protection system is provided by the
hardware and the operating system
Operating System Concepts Essentials – 8th Edition 13.26 Silberschatz, Galvin and Gagne ©2011
Protection in Java 2
Protection is handled by the Java Virtual Machine (JVM)
The protection domain indicates what operations the class can (and cannot) perform
If a library method is invoked that performs a privileged operation, the stack is inspected to ensure the
operation can be performed by the library
Operating System Concepts Essentials – 8th Edition 13.27 Silberschatz, Galvin and Gagne ©2011
Stack Inspection
Operating System Concepts Essentials – 8th Edition 13.28 Silberschatz, Galvin and Gagne ©2011
End of Chapter 13
Operating System Concepts Essentials– 8th Edition Silberschatz, Galvin and Gagne ©2011