Lecture - 10 - OS Security
Lecture - 10 - OS Security
OS Security
Protection in General-Purpose OS
Overview
• Protected Objects and Levels of Protection
– History of Protection in OSs
• Memory and Address Protection Techniques
– Fence
– Relocation
– Base/Bounds Registers
– Tagged Architecture
– Segmentation
– Paging
– Combined Paging with Segmentation
– Intel’s Software Guard Extensions®
• Kinds of Separation?
Security in OS
• Kinds of separation:
– Physical separation
• Different processes use different physical objects
– Temporal separation
• Processes executed at different times
– Logical separation
• Illusion that OS executes processes only for single user
– Cryptographic separation
• Processes conceal their data and computations from
other processes
– Combinations of the above
Security in OS
• Strength of security via separation (least to
most secure):
– Logical separation
Increasing
– Temporal separation
Level of
– Physical separation security
• Where would you put cryptographic
separation?
Security in OS
• Complexity of implementation of separation
(least to most complex):
– Physical separation
Increasing
– Temporal separation
Complexity of
– Logical separation implementation
– Cryptographic separation
Security in OS
• Resource utilization in different kinds of
separation:
– Poor: physical separation / temporal separation
– Good: logical separation / cryptographic
separation
User B
Program Space
advantage: the ability to split a program into two pieces that can be relocated separately.
Memory and Address Protection
• Tagged Architecture
– Problem with base/bounds registers:
• Lesser granularity of access rights (ARs)
– Can allow another module to access all or none of its
data, within limits of data base-bounds registers
– Solution: tagged architecture (gives more granularity
of access rights)
– Every word of machine memory has ≥1 tag bits
defining access rights to this word (a h/w solution!)
Memory and Address Protection
• Tagged Architecture
– Access bits set by OS
– Tested every time
instruction accesses
its location
– # of bits ~ # of
different access rights
Memory and Address Protection
• Benefit of tagged architecture
– More granularity of memory access control
• at memory word level
• Problems with tagged architecture:
– Requires special hardware
– Incompatible with code of most OSs
– Computation cost
• Accommodate tags in each memory word
• Test each memory word accessed
– Higher memory costs (extra bits per word)
Memory and Address Protection
• Segmentation
– Benefits addressing + enhances memory
protection for free
– Effect of an unbounded number of base/bounds
registers
– Program segmentation:
• Program divided into logical pieces (called segments)
– E.g., Pieces are: code for single procedure/ data of an array
– Consecutive program segments can be easily
stored in nonconsecutive memory locations
– Allows a program to be divided into many pieces
having different access rights
Memory and Address Protection
• Logical and Physical Representation of Segments
Memory and Address Protection
• Addressing with segmentation
– Data item D addressed as:
• (segment_name_of_D, offset_of_D_within_segment)
– Instructions addressed analogously
– For each process, OS keeps a separate
• Segment Translation Table (STT)
– Rows in STT: (segment_name, segment_offset)
• segment_name – name of segment containg data item
• segment_offset – starting location for named segment
Memory and Address Protection
• Paged
Segmentation
Intel’s Software Guard Extensions (SGX)
• SGX is a combination of an instruction set
and an API
• Meant to provide secure software ‘enclaves’
• Data and code can reside/execute without
inspection or modification
• Provides a root of trust even in an untrusted
environment e.g., cloud computing
• Threat model: the enclave is trusted but no
process outside it can be trusted (including
the OS itself and any hypervisor
Intel’s Software Guard Extensions (SGX)