Operating System Protection: Isolation and Virtual Machines

Learn how an operating system protects itself and its users. Follow how the processor's privilege levels, system calls and page-table permissions keep programs apart; how the system checks who you are and stores passwords safely; and how access control lists, capabilities, Unix and Windows permissions and mandatory policies decide who may use what. Then see how hypervisors run complete operating systems side by side in virtual machines, and how containers isolate applications with namespaces, control groups and privilege limits, so you can choose the right boundary for a workload.

IntermediateLesson 9 of 9 in Operating Systems Course

What you will learn

  1. Describe the processor modes, controlled entry points and memory protections that keep programs from damaging each other or the kernel, and the mechanisms that make attacks on them harder.
    • Separate user mode from kernel mode
      Explain privilege levels and privileged instructions, and what happens when a program tries to do something only the kernel may do.
    • Enter the kernel safely through system calls
      Follow a system call from the trap to the permission check, and explain why the kernel must distrust every argument it receives.
    • Protect memory and devices
      Use page-table permissions, kernel-only mappings and the IOMMU to explain how the kernel keeps each process inside its own memory.
    • Make attacks on programs and the kernel harder
      Explain how no-execute memory, address randomization, system-call filters, secure boot and audit logs raise the cost of exploits and leave a record.
  2. Explain how an operating system checks who a user is, stores passwords safely, uses other authentication factors and carries the resulting identity into every process.
    • Attach identities to processes
      Follow a login from the password prompt to a running shell, and explain user IDs, groups, inheritance and programs that change privilege such as setuid programs and sudo.
    • Store and check passwords safely
      Explain hashing, salting and slow password-hashing functions, and calculate how they change the cost of guessing attacks.
    • Authenticate with what you have and what you are
      Compare passwords, tokens and biometrics, combine them in multi-factor authentication, and authenticate services and machines that have no person at the keyboard.
  3. Represent rights as an access matrix, implement them with access control lists or capabilities, read and set Unix and Windows permissions, and compare discretionary, mandatory and role-based models.
    • Compare access control lists and capabilities
      Store the same rights by object or by subject, and weigh the two approaches for checking, reviewing, delegating and revoking access.
    • Read and set Unix and Windows permissions
      Interpret permission bits and octal modes, apply the Unix checking rules to files and directories, and read POSIX ACLs and Windows access control entries.
    • Compare discretionary, mandatory and role-based access control
      Distinguish models where owners decide from models where a system-wide policy decides, and use roles to manage the rights of many users.
  4. Explain how a hypervisor shares one computer's processor, memory and devices among several complete operating systems while keeping them isolated.
    • Describe virtual machines and hypervisors
      Define virtual machines and hypervisors, tell Type 1 from Type 2 designs, and explain what virtualization is used for and where its isolation ends.
    • Virtualize the processor
      Explain trap-and-emulate, why classic x86 could not use it directly, and how binary translation, paravirtualization and hardware support solved the problem.
    • Virtualize memory
      Translate a guest's virtual address to a real machine address, and compare shadow page tables with hardware nested paging.
    • Virtualize devices and keep virtual machines apart
      Compare emulated, paravirtual and passthrough devices, and explain the strengths and limits of the isolation between virtual machines.
  5. Build a container from kernel features (namespaces for what a process can see, control groups for what it can use and privilege limits for what it can do) and decide when to use a container or a virtual machine.
    • Limit what a process sees with namespaces
      Explain the Linux namespace types, create and join namespaces, and interpret PID, mount, network and user namespaces.
    • Limit what a process uses with control groups
      Organize processes in control groups and set CPU, memory, process-count and I/O limits, interpreting the limit values.
    • Restrict containers and choose between containers and virtual machines
      Reduce what a containerized process may do, explain the risk of a shared kernel, and choose containers, virtual machines or both for a given workload.

Operating System Protection study guide

5 chapters

1

Explain how hardware and the kernel protect the system

Programs run quickly because ordinary instructions execute directly on the processor. Hardware permissions and controlled kernel entry points make that freedom safe enough to share a machine. Follow the boundary from CPU privilege through system-call checks to memory and device access, then see how execution restrictions, randomization, boot verification and logs limit attacks on programs and the kernel.

1.1 Separate user mode from kernel mode

A program needs enough freedom to calculate quickly without gaining control of the whole computer. User mode lets it run ordinary instructions directly. Kernel mode, also called supervisor mode, gives the operating system access to the instructions that control the machine.

Let hardware enforce privilege

The CPU carries a current privilege level. Addition, loads, stores and jumps normally run at full speed, subject to memory permissions. The kernel does not inspect each instruction in software. This is limited direct execution: run directly until a protected operation or an interrupt needs the kernel.

A privileged instruction traps if user code tries it. On x86-64, HLT, writing the page-table base register CR3, and installing an interrupt table with LIDT need kernel privilege. Otherwise an application could stop the CPU, replace its own memory boundaries or redirect interrupt handling.

Suppose an application executes HLT. The CPU raises a general-protection fault instead of halting. It enters the kernel's registered handler. Linux normally sends the process SIGSEGV, ending that process while other programs continue. The application cannot choose a convenient address inside the kernel and start executing there.

Cross the boundary through a controlled entry

Traps, exceptions and interrupts enter through addresses registered by the kernel. Hardware changes privilege and transfers control to the handler; kernel entry code preserves the state needed to return. A special return instruction restores user execution at the saved program counter. On x86-64 the return can use SYSRET or IRETQ.

The timer makes this control useful even when a program never asks for a service. Before running it, the kernel programs a timer. When the interrupt arrives, the scheduler can select another process. User code cannot disable interrupts or reprogram that timer, so an endless loop cannot keep a core forever.

Read privilege diagrams correctly
ArchitectureApplicationKernelOther levels
x86Ring 3Ring 0Rings 1 and 2 exist but ordinary Linux and Windows kernels leave them unused
ARMv8-AEL0EL1EL2 supports a hypervisor; EL3 supports the secure firmware monitor
RISC-VU modeS modeM mode has machine privilege

The numbering conventions differ: a lower x86 ring number means more privilege, while a higher ARM exception level means more privilege. Intel virtualization also adds VMX root and non-root operation; these are separate from the ring number.

Keep identity separate from CPU mode

Root is a user identity, UID 0, that kernel software recognizes. A root application's ordinary code still runs in user mode and enters the kernel through system calls. A device driver executing in kernel mode has much more direct power: a memory bug there can damage kernel state without passing a file-permission check.

The layer enforcing a boundary must control the layer inside it. The kernel enforces process boundaries with CPU modes and memory tables. A hypervisor similarly controls guest operating systems using hardware virtualization support.

Key Takeaways

  • User instructions run directly until hardware requires a kernel entry.
  • Privileged operations protect page tables, interrupts, timers and device control.
  • The timer lets the scheduler regain a core from an endless loop.
  • Root identity does not put an application in kernel mode.
  • Privilege numbering depends on the architecture.

1.2 Enter the kernel safely through system calls

A system call is a controlled request for a kernel service. Opening files, creating processes and sending network data all require decisions an application cannot safely make for itself. Entering the kernel gives the handler authority; it does not give the caller permission to do whatever it requested.

Follow the request

A C library wrapper such as open() places the call number and arguments in registers. It uses SYSCALL on x86-64, SVC on ARM64 or ECALL on RISC-V. The kernel then:

  1. Enters through its registered entry point and saves user registers.
  2. Selects the handler from the system-call table, rejecting an unknown number.
  3. Reads the caller's identity and credentials from the current process.
  4. Checks arguments, access rights and the objects involved.
  5. Performs the operation or returns an error.
  6. Restores the saved state and returns to user mode.

The identity comes from process credentials, not a user-supplied name. A caller cannot gain another user's rights by adding that user's name to a request.

Treat arguments as untrusted

A pointer is just a number supplied by the caller. The kernel must verify the whole requested user-memory range, including its length and access direction. Linux uses checked routines such as copy_from_user and copy_to_user to cross the boundary safely.

For read(fd, buf, 4096), a buf pointing into kernel memory must not become a destination for file data. Linux reports EFAULT for that bad user buffer. A different error has a different cause: write() through a descriptor opened with O_RDONLY fails with EBADF, because the descriptor was never granted write access. An ordinary denied request returns an error; it does not automatically end the process. In C, the wrapper commonly returns −1 and sets errno.

Check the object actually used

A time-of-check-to-time-of-use (TOCTTOU) race separates a decision from the object it was meant to protect. A privileged helper checks access("/tmp/report", W_OK), then opens the path. An attacker replaces the path with a symbolic link to /etc/passwd between those operations. The name is unchanged, but the opened object is different.

The repair is to perform the access under the intended credentials on the object actually opened. Drop privileges before opening, and use flags such as O_NOFOLLOW when symbolic links are unwanted. Copying arguments into kernel memory once also avoids repeatedly trusting mutable user data; the copied structure must still be validated.

Identify what must be trusted

A reference monitor mediates access. It must be invoked whenever access is acquired, protected from tampering and small enough to examine carefully. After the kernel grants a memory mapping, individual loads and stores go through the MMU's permission checks; they do not each make a system call.

The trusted computing base (TCB) is the hardware, firmware and privileged software whose correctness protection depends on. It includes the CPU, boot chain, kernel and trusted login components. Moving drivers or file systems into user-mode servers can shrink the kernel portion of this base, as microkernel designs do. A compromised ordinary application misuses its granted rights; a compromised trusted component may undermine the checks themselves.

Key Takeaways

  • Kernel entry and permission to perform an operation are separate.
  • Validate pointer ranges and access rights before using user arguments.
  • A TOCTTOU race can make a checked name refer to a different object.
  • A reference monitor must resist bypass and tampering.
  • The TCB includes more than the kernel.
  • A refused system call usually returns an error the program can handle.

1.3 Protect memory and devices

Virtual memory protects programs as well as translating addresses. A process can reach the physical frames named by its active page table, with the permissions the kernel set. Another process's private frames are absent; deliberate shared-memory mappings are an explicit exception.

Check each memory access

The memory management unit (MMU) checks page-table entries on accesses. Important permissions include present or valid, writable, user-accessible and executable. On x86, U/S distinguishes user-accessible from supervisor-only pages; NX or XD disables execution. ARM calls its execute restriction XN.

A violation raises a page fault. The fault reports a failed hardware check; the kernel decides whether that failure is expected and repairable. Consider two stores to read-only pages:

  • A process overwrites a code page that is not copy-on-write. The kernel treats it as an invalid write and normally sends SIGSEGV.
  • After fork(), a process writes shared data marked copy-on-write. The kernel allocates a private copy, changes the mapping to writable and retries the instruction.

Both faults start from a protection bit. Kernel records explain why the mappings were read-only and determine the response. A page fault is therefore not automatically a crash or a request to fetch data from disk.

Protect kernel mappings in both directions

Traditional layouts map kernel memory into process address spaces as supervisor-only, making kernel entry convenient while blocking user-mode reads and writes. The 2018 Meltdown attack showed that some processors could leak such data through speculative execution. Kernel page-table isolation (KPTI) removes most kernel mappings while user code runs on affected systems.

Kernel code also needs protection against being redirected into user-controlled memory. x86 SMEP prevents kernel-mode execution from user pages. SMAP blocks kernel-mode data accesses to user pages except during deliberately authorized copy operations. ARM provides related protections through PXN and PAN. These checks reduce the ways an attacker can use a kernel bug to execute code or supply fake kernel data.

Read-only access protects integrity, not secrecy. If a process can read a mapped page, it can learn its contents even when writes fail. Confidential data must be inaccessible to that process: leave it unmapped or enforce an appropriate supervisor-only boundary.

Give devices their own boundary

Applications usually request device work through a driver. Device registers are normally kernel-only, though an authorized process can receive selected mappings, as with graphics drivers or Linux userspace I/O.

A device performing direct memory access (DMA) reads or writes RAM without sending those accesses through the CPU's MMU. CPU page permissions alone cannot stop a faulty device overwriting another process's frames. An IOMMU translates and restricts device addresses with per-device mappings. Intel VT-d and AMD-Vi supply this mechanism.

For a device assigned to a VM, the IOMMU restricts DMA to that VM's assigned memory. The CPU side needs a parallel boundary: a second stage of page translation maps guest physical addresses only to frames the hypervisor permits. Protecting a workload requires covering both CPU accesses and device accesses.

Key Takeaways

  • The MMU enforces the mappings and permission bits the kernel installs.
  • A page fault can trigger recovery, copy-on-write or a fatal signal.
  • Read-only access does not make data confidential.
  • KPTI removes most kernel mappings during user execution.
  • SMEP and SMAP restrict kernel use of user pages.
  • The IOMMU confines DMA that bypasses the CPU MMU.

1.4 Make attacks on programs and the kernel harder

A memory-safety bug can become an attack when corrupted data changes the program's control flow. A stack buffer overflow, for example, can overwrite a saved return address. Operating-system defenses restrict what an attacker can do with that bug; they do not repair the faulty write.

Separate data from executable code

The NX bit marks data pages non-executable. Windows calls this Data Execution Prevention (DEP). Injecting instructions into a stack buffer is less useful when jumping there causes a fault.

W^X, write xor execute, is stricter: no page is writable and executable at the same time. DEP alone does not forbid a program from explicitly requesting such a mapping. Under W^X, a just-in-time compiler writes generated code into writable memory, then changes its permissions before executing it.

An attacker can instead reuse existing executable instructions. Return-oriented programming (ROP) chains short instruction sequences called gadgets. Address space layout randomization (ASLR) changes the locations of stacks, heaps, libraries and position-independent programs, making gadget addresses hard to predict.

With a library base chosen uniformly from 228 positions, one blind guess succeeds with probability 1 in 268,435,456. With only 28=256 positions and a layout preserved across worker crashes, trying distinct positions needs at most 256 attempts and 128.5 on average. A leaked address inside a known library reveals its base and gadget offsets in that library. A separately randomized stack can still remain unknown.

Reduce the services an attacker can request

Linux seccomp filters restrict the system calls a process may make. A browser renderer, for example, can be denied calls for launching programs or directly opening files. Filters are inherited by children and cannot be removed; later filters can tighten restrictions. An exploited renderer still has its allowed operations, so a filter is a boundary around services, not proof that the program is bug-free. OpenBSD pledge and the macOS App Sandbox provide related restrictions.

Check startup and preserve evidence

Secure boot checks signatures along the boot chain. Firmware checks a trusted boot loader; the loader checks the kernel; the kernel can require signed modules. A modified component without a trusted signature is refused. This helps stop persistent changes to boot software, but a valid signature does not prove the software has no vulnerabilities.

Measured boot records hashes of loaded components, commonly using a Trusted Platform Module (TPM). These measurements support attestation: another party can compare what started with an expected state. Measuring and refusing to start are different operations.

Audit logging records logins, authentication failures, permission denials, account changes and privileged actions such as sudo. Logs support detection and reconstruction. An attacker who controls a host may erase local records, so protected or remote logging preserves evidence beyond that host.

Attackers can combine an address leak, a memory corruption bug and a sandbox escape. Updates remove the underlying vulnerabilities that these defenses leave in place.

Key Takeaways

  • NX blocks execution from marked data pages; W^X also forbids simultaneous write and execute permissions.
  • ASLR makes code-reuse addresses harder to predict.
  • A library address leak need not reveal separately randomized regions.
  • System-call filters restrict the services available to an exploited process.
  • Secure boot verifies trust in startup components; measured boot records what loaded.
  • Audit logs support detection and reconstruction, so protect them from deletion.
2

Authenticate users and give processes an identity

A user name becomes useful to the kernel only when it is connected to trustworthy process credentials. Follow a login into a running shell, including the careful handling of elevated helpers. Then examine how salted password hashes make stolen verifiers harder to attack, and how keys, time-based codes and biometrics change the proof of identity before normal permission checks begin.

2.1 Attach identities to processes

Successful login connects a human identity to kernel-held process credentials. Authentication checks the claimed identity; authorization decides what that identity may do. A principal may be a person or a service account, and processes act on its behalf.

Carry identity into running programs

Unix-like systems identify users by numeric UIDs and groups by GIDs. /etc/passwd maps names to UIDs, home directories and shells. Kernel comparisons use the numbers: two account names with one UID are one identity for access checks. UID 0 is root and bypasses most ordinary permission checks.

Windows uses security identifiers (SIDs) for users and groups. A process's access token records its user SID, group SIDs and privileges. On both platforms, the running program's credentials supply the identity for later decisions.

A typical Linux password login follows this sequence:

  1. A privileged login service, such as login, sshd or a display manager, receives the credentials.
  2. PAM, Pluggable Authentication Modules, checks them through configured authentication modules.
  3. The service installs the user's supplementary groups and GID, then changes the UID to give up root.
  4. It starts the shell. Children inherit these credentials through fork() and normally retain them across execve().

The ordering matters. Giving up root before setting groups can leave the process unable to replace its inherited privileged group list. Also, editing an account's group membership does not rewrite credentials in already running processes; a new login session gets the new list.

Understand a controlled privilege change

A process has a real UID, normally identifying who started it; an effective UID, used for most access checks; and a saved set-user-ID, supporting controlled changes back after a temporary reduction. Ordinary programs have all three equal.

The root-owned /usr/bin/passwd illustrates setuid. Its mode 4755, shown -rwsr-xr-x, makes the effective UID root when an ordinary user executes it. If alice has UID 1000, her real UID remains 1000 while the effective UID becomes 0. The program can update /etc/shadow and uses the caller's real identity to restrict whose password may change. A setgid executable similarly changes the effective group.

That small trusted program holds dangerous authority. A bug can expose root rights, so systems minimize setuid programs and drop privileges early. For a service that only needs a low-numbered port, CAP_NET_BIND_SERVICE grants a narrower Linux privilege than full root.

Administer without sharing one identity

sudo authenticates the invoking user, checks which commands that user may run as which target identity, and logs the use. Its policy is commonly in /etc/sudoers. Individual identities preserve accountability that sharing a root password loses. On Windows, UAC normally starts an administrator's programs with a filtered token and requests consent for elevation.

Everyday applications should run with ordinary rights, and services should have dedicated accounts such as www-data. An exploited document viewer then inherits those limited credentials instead of an administrator's full authority.

Key Takeaways

  • Authentication establishes identity; authorization checks rights.
  • Unix checks numeric UIDs and GIDs; Windows uses SIDs and tokens.
  • Set groups before permanently giving up the privilege to change them.
  • The effective UID supplies most Unix access checks.
  • Setuid helpers need careful checks because they hold elevated authority.
  • Existing processes keep their old group list after an account edit.

2.2 Store and check passwords safely

A password verifier needs to recognize a correct password without storing a recoverable copy. It stores a password hash with the information needed to repeat the check. Login recomputes the hash from the entered password and compares results; it never decrypts the stored hash.

Protect the stored verifier

On Linux, /etc/shadow holds protected password hashes. The widely readable /etc/passwd contains account information and an x in place of the password. A shadow password field records an algorithm identifier, cost parameters, a salt and the resulting hash. $y$ identifies yescrypt, used by default in Debian 11, Ubuntu 22.04, Fedora 35 and later; $6$ identifies SHA-512-crypt.

A stolen hash file enables an offline attack. The attacker hashes guesses on separate hardware without the login service's delays. A brute-force attack enumerates strings; a dictionary attack begins with likely words, leaked passwords and variations such as "Password1!".

For exactly eight lowercase letters, 268=208,827,064,576 strings are possible. At 1010 guesses per second, exhausting the space takes about 21 seconds. At 104 guesses per second, it takes about 2.09×107 seconds, roughly 242 days. These are full-search times, not guarantees for an individual password. Twelve lowercase letters give about 9.5×1016 strings, roughly 110 days even at the faster rate.

Make each account expensive to attack

A salt is a fresh random value stored beside each password hash. It makes equal passwords produce different hashes and defeats reusable precomputed tables. The salt is public; its job is to force separate work for different accounts.

Consider 1,000 accounts and a list of 106 guesses, checked at 104 hashes per second. Without salts, computing the list once takes 100 seconds and serves all accounts. Unique salts require 109 computations, about 105 seconds or 27.8 hours. A common password may still be found near the start of the list.

Password-hashing schemes such as bcrypt, scrypt, yescrypt, Argon2 and PBKDF2 have adjustable work costs. Scrypt, yescrypt and Argon2 also impose memory costs. A practical login can tolerate a fraction of a second; a large guessing campaign repeats that expense millions of times. A single fast SHA-256 computation lacks this deliberate cost.

Design the login policy around guessing

NIST SP 800-63B-4 (2025) requires salts of at least 32 bits and a password-hashing cost as high as practical. Its password guidance requires at least 15 characters for password-only authentication, or at least eight when the password is part of MFA, and recommends accepting at least 64 characters.

It rejects mandatory mixtures such as one digit and one symbol and routine forced password changes. It requires blocking common or compromised choices, limiting online guessing, and forcing a change when compromise is evident. Online rate limits protect the live service; slow salted hashing protects stolen verifiers. A longer password selected predictably from a common list can still be weak.

Key Takeaways

  • Login recomputes a password hash; it does not decrypt a password.
  • Offline guessing bypasses the live login service’s rate limits.
  • A unique public salt prevents reuse of hashing work across accounts.
  • An adjustable work cost makes each guess expensive.
  • Password length and blocklists help more than predictable composition rules.

2.3 Authenticate with what you have and what you are

Passwords prove knowledge. Other authenticators prove possession of an object or a physical trait. The operating system eventually attaches the authenticated identity to processes, but the route to that identity affects how easily an attacker can impersonate the user.

Combine different factor types

The three factor types are something you know, such as a password or PIN; something you have, such as a phone, smart card or security key; and something you are, such as a fingerprint. Multi-factor authentication (MFA) combines different types. A password plus a security question repeats the knowledge factor.

Time-based one-time passwords (TOTP) use a shared secret and a time step, usually 30 seconds, to produce matching codes on an authenticator and server. RFC 6238 defines the method. A code expires quickly, but a fake login page can relay a fresh code before it expires. App codes avoid SIM swapping; SMS codes depend on control of the phone number and can be redirected if it is taken over.

Prove possession without sending the key

A public-key authenticator signs a fresh challenge with a private key. The server verifies it with a stored public key, which cannot itself be reused to sign a login. FIDO2 security keys and passkeys also bind authentication to the site's identity, so a response for a fake site cannot authenticate at the real one. An ordinary SSH key proves possession too, but should not be assumed to have the same website-binding mechanism.

Storage changes the risk. Device-bound keys in a hardware security key, TPM or secure enclave sign inside hardware without exposing the private key. Synced passkeys copy encrypted key material between devices through a platform account, making recovery easier while bringing that account into the trust boundary. An ordinary SSH private key is a file protected by permissions and, optionally, a passphrase.

Interpret biometric errors

A biometric system compares measured features with a stored template. It accepts when a similarity score meets a threshold; it does not require an identical image each time.

RatePopulation used as denominatorError counted
False acceptance rate (FAR)Impostor attemptsImpostors accepted
False rejection rate (FRR)Genuine attemptsGenuine users rejected

Two accepted impostors out of 10,000 give FAR 0.02%. Thirty rejections out of 1,000 genuine attempts give FRR 3%. Raising the similarity threshold lowers FAR while raising FRR. A more demanding match reduces successful impersonation but makes legitimate retries more common.

A leaked biometric trait cannot be changed like a password, and sensors need defenses against photos or copied fingerprints. A useful design uses biometrics locally to unlock a protected key, sending only a signature to the server.

Authenticate processes too

For a local Unix-domain connection, Linux SO_PEERCRED obtains peer credentials from the kernel instead of trusting a name the client sends. Across machines, services use keys, certificates or tokens stored under restricted service-account access. After login, ordinary OS access checks use the UID or access token; they do not ask whether the user typed a password or touched a key.

Key Takeaways

  • MFA combines different factor types, not merely two questions.
  • TOTP codes can be relayed while valid.
  • Public-key login proves possession without sending the private key.
  • FIDO2 binds authentication to the intended site.
  • FAR and FRR use different attempt populations.
  • A stronger biometric threshold trades fewer impostor accepts for more genuine rejects.
  • Local peer credentials should come from the kernel.
3

Control access to files and other resources

An authenticated identity still needs a decision about each resource it requests. Represent rights in an access matrix, then compare lists attached to objects with tokens held by processes. Work through file and directory permissions before adding mandatory policy and job roles. The same request can involve an open handle, ordinary mode bits and a centrally enforced service boundary.

3.1 Compare access control lists and capabilities

An access decision has three parts: a subject asks to perform an operation on an object. The subject is usually a process acting for a principal; objects include files, devices and other processes. An access matrix represents the rights in cells, with subjects as rows and objects as columns.

Store the same rights in two ways

Suppose alice can read and write report.txt, bob can only read it, and the backup service can read both report.txt and payroll.db. Bob can also read and write payroll.db. Alice and bob may use the printer; the backup service may not. Most cells in a real system's much larger matrix are empty.

An access control list (ACL) stores a column with its object. The list on report.txt names alice, bob and backup with their respective rights. A capability list stores a row with the subject. Bob holds tokens for reading the report, reading and writing payroll, and using the printer.

QuestionACLCapability list
Who may use this object?Inspect its listFind all holders
What may this subject use?Inspect many objectsInspect its tokens
How are narrow rights delegated?Add or change entriesPass selected tokens with no added rights
What makes revocation difficult?Existing granted handles can remainCopies of tokens may have spread

A capability names both an object and allowed operations and cannot be forged or enlarged by its holder. Authorized copying and delegation are possible. The kernel may hold the real token while user code holds an index; another design protects a token cryptographically.

Follow a descriptor after open

Unix combines both approaches. open() checks the caller against the file's permissions, then returns a file descriptor recording granted access. Later reads and writes check that open handle. A child can inherit it through fork(), or a process can receive it over a Unix-domain socket.

Alice opens app.log for writing. Its owner changes the mode to 444. Alice's already open descriptor can still write; a new attempt to open the file for writing encounters the new mode. Updating the ACL governing future opens does not cancel every capability already issued. Windows handles follow the same general pattern.

FreeBSD Capsicum makes this useful for confinement. After cap_enter(), a process cannot open an arbitrary absolute path. It can operate through existing descriptors, receive descriptors and use openat() beneath a directory descriptor it holds. A parent can therefore give a worker exactly the files it needs. Capability-based kernels such as seL4 and Fuchsia extend the idea to kernel objects generally.

Distinguish Linux's other meaning of capability

Linux capabilities divide root's privileges into categories. CAP_NET_BIND_SERVICE permits binding low-numbered ports; CAP_DAC_OVERRIDE bypasses ordinary file access checks. These privileges do not name one particular object, so they are different from an access-matrix capability. A single Linux privilege can authorize a class of operations across many objects.

Key Takeaways

  • ACLs organize rights by object; capability lists organize them by subject.
  • A capability cannot be forged or expanded by its holder.
  • Descriptors preserve access granted when an object was opened.
  • Changing a file’s mode does not normally revoke existing descriptors.
  • Linux capabilities divide root privileges and do not name individual objects.

3.2 Read and set Unix and Windows permissions

Unix permissions attach rights to the owner, owning group and everyone else. To decide access, first identify the operation and the relevant object. Reading file contents, traversing a directory and deleting a name require different permissions.

Decode and select the bits

Read is 4, write 2 and execute 1. Add these values for each class: 754 means rwxr-xr--; 640 means rw-r-----. chmod 640 notes.txt sets a mode, while chmod g+w,o-r notes.txt edits selected bits. The owner or root may change the mode; changing ownership needs root authority, represented by CAP_CHOWN on Linux.

The kernel selects the first matching class: owner if the effective UID matches, otherwise group if a process group matches, otherwise others. It does not combine classes or retry a more generous one. Alice owns a mode-077 file: its owner bits are empty, so she cannot read it even though group and others have full rights. She can still change the mode as its owner.

Root normally bypasses read and write checks. For executing a regular file under ordinary Linux discretionary checks, at least one execute bit must be set. Mandatory policy can impose further restrictions.

Interpret directory and special bits

Directory read lists names; execute permits traversal and lookup; write together with execute permits creating, deleting and renaming entries. Removing a name changes its directory, so a mode-000 file can be deleted by someone with the needed directory rights.

Setuid adds octal 4000 to an executable's mode and changes the effective user identity on execution. Setgid adds 2000 and similarly changes the group; on a directory it makes new files inherit the directory's group. The sticky bit adds 1000. A directory such as /tmp, mode 1777, allows deletion or renaming only by the file owner, directory owner or a privileged process, with ordinary directory permissions still required.

Remove bits when creating files

A umask clears bits from the mode a program requests. It is a bit operation, not octal subtraction. With the usual requests of 666 for files and 777 for directories:

UmaskNew fileNew directory
022644755
027640750
000666777

A umask cannot add execute rights that were absent from the file request.

Read richer access lists

POSIX ACLs add named users and groups. setfacl -m u:bob:r report.txt gives bob a named read entry; getfacl displays it and ls -l marks the extended ACL with +. The ACL mask limits named users, named groups and the owning group, so a named entry may show more rights than are effective.

Windows NTFS uses a security descriptor with an owner SID and a DACL of ordered allow or deny ACEs. Evaluation stops when a requested right is denied or all requested rights have been granted; rights left ungranted are denied. Preferred ordering places explicit entries before inherited ones, with deny before allow within each group. An explicit allow can therefore resolve a request before an inherited deny is reached. A separate SACL selects access events for auditing.

Key Takeaways

  • Choose the matching Unix permission class before checking its bits.
  • Directory permissions govern names; file permissions govern file contents.
  • The sticky bit adds an ownership check for deletion and renaming.
  • A umask clears requested bits and never adds them.
  • The POSIX ACL mask caps the group class and named entries.
  • Windows DACL evaluation depends on ACE order.
  • A SACL selects auditing rather than granting access.

3.3 Compare discretionary, mandatory and role-based access control

Different access-control models answer different management questions. Who may grant access? Can a compromised program share a user's data? How can an administrator change the rights of many employees without editing each file? One operating system can apply several models to the same request.

Distinguish owner choice from system policy

In discretionary access control (DAC), an object's owner decides who may use it. Unix modes and ACLs are familiar mechanisms. The weakness is that a malicious program acting as the user can exercise the user's rights, including copying readable data elsewhere.

In mandatory access control (MAC), an administrator's system-wide policy limits access independently of the owner's wishes. The kernel applies MAC in addition to DAC. Both checks must allow access, so a permissive file mode does not override a mandatory denial.

The Bell–LaPadula model protects confidentiality with ordered levels and two rules: no read up and no write down. A Secret process can read Confidential data and write to a Top Secret destination. It cannot read Top Secret data or write Confidential data. A program cannot move information from Secret to Confidential simply by reading and rewriting it. Biba reverses the read and write directions to protect integrity.

Confine a service even when it is root

SELinux labels files with types and runs processes in domains. Policy names which domain may perform which operations on each type; unlisted access is denied. A web server in httpd_t may read pages labeled httpd_sys_content_t while being blocked from user_home_t, even if ordinary Unix modes permit the read. ls -Z shows labels.

In enforcing mode, SELinux blocks and logs violations. In permissive mode, it logs without blocking. Root in a confined domain must still satisfy enforcing policy. UID 0 and unrestricted access are therefore different claims.

AppArmor confines programs with profiles based on file paths and allowed capabilities. It is commonly used on Ubuntu and SUSE. SELinux and AppArmor operate through Linux Security Module (LSM) hooks at security decisions. Android combines app-specific UIDs with SELinux; Apple systems also use application sandbox profiles.

Assign jobs instead of individual rights

In role-based access control (RBAC), permissions attach to roles and users receive role memberships. Moving a person between jobs changes memberships instead of many independent object permissions.

Suppose 50 employees each need 20 permissions. Direct assignment needs 1,000 user-permission links. If five roles each hold 20 permissions and every employee has one role, management needs 50 user-role links and 100 role-permission links: 150 total. The saving comes from shared job patterns, not from deleting required permissions.

Windows groups used as roles and group-based sudo policies implement this pattern. DAC suits owner-managed files, MAC contains services under centrally enforced rules, and RBAC organizes administrative assignments. A service may receive its job rights through a role while DAC and MAC both check its actual file access.

Key Takeaways

  • DAC lets owners choose access; MAC enforces a system-wide policy.
  • A request must pass both DAC and enforcing MAC.
  • Bell–LaPadula blocks reads upward and writes downward.
  • SELinux domains and types can confine root processes.
  • RBAC manages permissions through job roles.
4

Run operating systems inside virtual machines

Running several kernels on one computer adds a protection layer beneath the operating system. A hypervisor must preserve each guest’s view while keeping control of physical CPU time, memory and devices. Follow the mechanisms from trapped instructions to two-stage address translation, then compare device interfaces and the remaining paths through which a guest might affect its host.

4.1 Describe virtual machines and hypervisors

A virtual machine (VM) gives a complete operating system its own apparent computer. That operating system is the guest. The physical computer is the host, and the hypervisor, or virtual machine monitor (VMM), allocates real processor time, memory and devices to the guests.

Preserve behavior while retaining control

Popek and Goldberg's 1974 framework identifies three properties. Equivalence means programs behave as on a real machine, apart from timing and available resources. Resource control means the hypervisor remains in charge of the hardware. Efficiency means most guest instructions run directly on the processor.

The hypervisor schedules virtual CPUs (vCPUs) onto physical cores. A machine switch saves one VM's full execution state, including privileged registers and interrupt settings, then restores another's. A guest sees its own state even when it shares a physical core with other guests.

DesignWhere the hypervisor runsExamples
Type 1, bare-metalDirectly controls hardwareESXi, Xen, Hyper-V
Type 2, hostedRuns as an application using a host OSVirtualBox, VMware Workstation, Parallels Desktop

KVM turns the Linux kernel itself into a hypervisor and is usually classified as Type 1. A complete Linux host remains available, which makes the simple two-type distinction less clear. To reason about protection, identify which component really controls CPU and memory virtualization.

Use the machine abstraction

Server consolidation puts lightly used systems together. Twelve servers each averaging 5% of an eight-core computer need 60% of one such computer in aggregate. That average suggests consolidation is possible, but simultaneous peaks, RAM and device demand still require headroom.

A snapshot saves VM state for later restoration. Copying a disk image alone does not capture a running CPU and its memory. Live migration transfers a running VM to another host, copying memory and switching execution with a short pause. These operations are possible because the guest's machine state is represented as data the hypervisor manages.

VMs also support testing old systems, separating conflicting software and running different operating systems on compatible hardware. A VM can run a Windows guest alongside a Linux guest, each with its own kernel. Cloud server instances commonly use this boundary.

Separate virtualization from full emulation

An emulator can interpret or translate an instruction set for a different processor, such as ARM code on x86. Hardware virtualization normally runs guest instructions directly on a compatible processor and intervenes for sensitive events. This explains both its speed and its need for CPU support.

Separate guest kernels form a useful boundary: taking over one guest kernel does not directly give control of the host kernel. The boundary still depends on correct hypervisor and device-model code. A VM escape exploits that layer, while a side channel may leak data through shared hardware without granting ordinary memory access. Choosing a VM reduces the interfaces exposed to an untrusted guest; it does not make shared hardware infallible.

Key Takeaways

  • A VM presents a complete machine to its guest operating system.
  • Equivalence, resource control and efficiency describe a VMM’s job.
  • A vCPU is scheduled onto a physical CPU.
  • Snapshots and migration depend on saving and transferring machine state.
  • Consolidation needs peak-demand headroom, not just a low average.
  • VM isolation depends on hypervisor, device-model and hardware correctness.

4.2 Virtualize the processor

A guest kernel expects to control its machine. The hypervisor must preserve that appearance without handing over the real computer. CPU virtualization lets ordinary guest instructions run directly and intercepts operations that need a change to virtual machine state.

Trap and emulate virtual state

In classic trap-and-emulate, the guest kernel is deprivileged. Its attempt to load a page-table register or install a trap table traps to the hypervisor. The hypervisor updates the guest's virtual register or table and resumes execution. It does not let the guest replace the real hypervisor's control structures.

A guest system call can require several crossings in this design. The guest application traps into the real handler owned by the hypervisor. The hypervisor transfers execution to the guest kernel's recorded handler at reduced privilege. When the guest kernel returns, that privileged return traps again; the hypervisor completes the real return to the guest application.

Popek and Goldberg's condition for this technique is that every sensitive instruction must be privileged. Sensitive means it changes machine configuration or behaves differently with privilege. Privileged means it traps outside the most privileged mode. Silent differences cannot be emulated if the hypervisor never learns that they occurred.

Understand the classic x86 obstacle

Robin and Irvine's 2000 analysis identified 17 sensitive unprivileged x86 instructions. For example, POPF can restore the interrupt-enable flag with sufficient privilege but silently leave it unchanged at reduced privilege. A deprivileged guest may believe it disabled interrupts even though no trap told the hypervisor to update its virtual interrupt state.

Three approaches solve this problem:

ApproachHow it intercepts the operationGuest change
Binary translationRewrites problematic guest kernel instructions before execution and caches translated codeNo source change
ParavirtualizationReplaces privileged operations with explicit hypercallsModified guest kernel
Hardware assistanceProvides separate guest operation and controlled VM exitsAn unmodified guest can run

VMware used binary translation in 1999; Xen used paravirtualization in 2003. Intel VT-x arrived in 2005 and AMD-V in 2006. Ordinary guest applications can still run directly when kernel code needs translation or hypercalls.

Keep ring number separate from virtualization mode

With Intel VT-x, the hypervisor runs in VMX root operation and a guest in non-root operation. The guest kernel can use ring 0 there. Ring 0 in a guest is not control over the physical host.

Configured events cause a VM exit, saving vCPU state in a control structure such as the VMCS. The hypervisor handles the event and resumes through a VM entry. Many system calls can stay entirely inside the guest. ARM uses EL2 for the hypervisor; RISC-V provides a hypervisor extension.

If a guest executes HLT and that event is configured to exit, the hypervisor marks its vCPU waiting and schedules other work until a virtual interrupt arrives. The physical core need not sit idle. Exits and entries still cost time, typically hundreds to thousands of cycles, so batching and paravirtual interfaces remain valuable.

Key Takeaways

  • Trap-and-emulate applies sensitive operations to virtual machine state.
  • Classic trap-and-emulate requires sensitive instructions to trap.
  • Binary translation rewrites code; paravirtualization changes the guest interface.
  • Guest ring 0 under VT-x remains separate from VMX root operation.
  • VM exits are controlled events with a real performance cost.

4.3 Virtualize memory

A guest application uses a guest virtual address. Its kernel translates that to a guest physical address, which is the guest's view of RAM. The hypervisor then maps that address to a host physical, or machine, address. Each guest can believe its RAM starts at zero while using different real frames.

Preserve the page offset

Use 4 KiB pages. The guest maps virtual page 2 to guest frame 7; the hypervisor maps guest frame 7 to machine frame 42. For address 0x2ABC:

  1. Split it into page 2 and offset 0xABC.
  2. Replace page 2 with guest frame 7, giving 0x7ABC.
  3. Replace guest frame 7 with machine frame 42, hexadecimal 0x2A.
  4. Keep the offset, giving machine address 0x2AABC, or 174,780 bytes from address zero.

Only the page number changes. Treating the guest physical address as a real RAM address would bypass the hypervisor's allocation and isolation decision.

Compare software and hardware translation

Shadow page tables map guest virtual pages directly to machine frames. The real MMU uses these tables, built by the hypervisor. The hypervisor write-protects guest page-table pages and intercepts guest table changes and switches so its shadows stay consistent. Frequent guest address-space changes therefore cause extra traps.

Nested paging, Intel EPT or AMD NPT, gives the MMU both stages. Hardware walks the guest tables and the guest-physical-to-machine tables. Guest page-table updates no longer all need software interception. The TLB caches the combined final translation.

A cache miss can still be expensive. With four levels at each stage, each of four guest-table entries needs four nested-table references plus the entry itself: 20 references. Translating the final guest physical data address adds four more, making 24 translation references before the data access. Large pages and page-walk caches reduce this worst-case uncached work.

Reclaim memory with limited guest knowledge

Memory overcommitment promises more total guest memory than the host has. Four 16 GiB VMs total 64 GiB on a 48 GiB host. This works only while their active needs fit; if they all become busy, reclamation or swapping becomes necessary.

A balloon driver inside a guest allocates pages at the hypervisor's request. The guest OS chooses what to free, while the hypervisor reclaims the machine frames behind balloon pages. This reduces the information gap: the guest knows which data matters, while the hypervisor sees allocations without all their meaning.

Page sharing, such as Linux KSM, merges identical pages into one read-only copy and splits it on a write. Hypervisor swapping provides another fallback, but can choose poorly because it lacks the guest's knowledge. A device passed to the VM also needs an IOMMU to translate and restrict its DMA addresses.

Sharing identical pages across customers has a privacy cost: copy-on-write timing can reveal whether another guest holds the same data. Cloud providers commonly disable that form of cross-customer sharing even though it saves memory.

Key Takeaways

  • Guest virtual, guest physical and machine addresses are different layers.
  • A page offset survives both translations unchanged.
  • Shadow tables require the hypervisor to track guest table changes.
  • Nested paging performs both stages in hardware and caches the combined result.
  • Overcommitment depends on demand staying below available capacity.
  • Ballooning uses guest knowledge; page sharing can expose timing information.

4.4 Virtualize devices and keep virtual machines apart

A VM needs storage, networking and other devices as well as CPU time and RAM. The device interface affects compatibility, performance and the code an untrusted guest can reach. A fast interface and a small trusted interface are related design choices, but they are not the same property.

Choose how the guest reaches a device
ApproachGuest interfaceMain tradeoff
EmulationA model of a familiar physical deviceExisting drivers work, but register operations require software work
Paravirtual deviceA virtualization-aware driver and shared queuesEfficient batching, but the guest needs the driver
PassthroughAn assigned physical device or virtual functionNear-native access, with harder sharing and migration

A helper such as QEMU can emulate an Intel e1000 network card. The ordinary guest driver writes familiar registers; the helper implements the effect. Frequent register accesses can cause many exits and software operations.

A virtio driver instead exchanges requests through shared-memory queues. It can enqueue several operations and notify the backend once. VMware's vmxnet3 and Hyper-V's VMBus devices follow related virtualization-aware designs. A paravirtual device driver does not mean the entire guest kernel must use paravirtual CPU operations.

In device passthrough, the guest owns a physical device or an SR-IOV virtual function. The IOMMU confines DMA to the VM's memory. Passthrough reduces software mediation, but transferring device state to another host can make live migration difficult.

Treat virtual disks as managed state

A virtual disk is commonly a host file, such as qcow2, VMDK or VHDX, or a storage volume. Copy-on-write images let many guests share a base while recording separate changes. Snapshots can preserve disk state cheaply, and a complete running snapshot also needs the VM's execution and memory state. Cloning and migration rely on the hypervisor's ability to manage these representations.

Locate the boundary an attacker must cross

A compromised guest kernel already controls that VM, but reaching the host requires a VM escape or another boundary failure. The 2015 VENOM flaw affected QEMU's emulated floppy-disk controller and could let guest code execute in the host's QEMU process. Keeping device emulation in a separate sandboxed process limits the authority exposed through such a bug.

Shared CPU caches, branch predictors and memory buses also create side channels. Spectre and L1TF showed that isolation cannot be judged from page mappings alone. Mitigations include processor and microcode updates, clearing relevant state between guests and avoiding simultaneous placement of different customers on sibling hardware threads of one core.

Confidential computing, including AMD SEV-SNP and Intel TDX, protects guest memory from the hypervisor with hardware-held encryption keys and supports attestation of the launched environment. It extends the trust boundary against a compromised host or operator. It does not remove every side channel or every way a host can interrupt service. VM security still depends on the hypervisor, device interfaces, hardware and their configuration.

Key Takeaways

  • Emulation favors compatibility; paravirtual queues reduce repeated exits.
  • Passthrough requires IOMMU confinement of device DMA.
  • Virtual disks and saved machine state support snapshots and migration.
  • Device-model bugs can create a VM escape.
  • Shared hardware can leak information without an ordinary memory-permission failure.
  • Confidential computing protects guest memory from the host within its hardware guarantees.
5

Isolate applications with containers

Containers build an isolated environment around ordinary host-kernel processes. Their private views, resource budgets and authority come from different kernel features, so each needs separate attention. Read namespace mappings and control-group settings, then connect them with privilege restrictions. Use the shared-kernel boundary to decide where containers, VMs or a combination fit a workload.

5.1 Limit what a process sees with namespaces

A Linux container is a set of processes using the host kernel with restricted views and privileges. It has no separate kernel or emulated computer. Namespaces give processes private instances of resources that would otherwise be global.

Match each namespace to its view
NamespaceWhat it separates
MountMounted file systems and the visible file tree
PIDProcess numbers and process visibility
NetworkInterfaces, addresses, routes, ports and firewall rules
UTSHost name and NIS domain name
IPCSystem V IPC objects and POSIX message queues
UserUser and group ID mappings and scoped capabilities
CgroupThe visible part of the cgroup hierarchy
TimeOffsets for monotonic and boot clocks

clone() with namespace flags creates a child in selected new namespaces. unshare() separates namespace context, and setns() joins an existing namespace through a descriptor such as one opened from /proc/1234/ns/net. PID reassociation affects later children without moving the caller. For time namespaces, unshare(CLONE_NEWTIME) also prepares a namespace for later children; setns() can move the caller into an existing time namespace. Time namespaces are created with unshare().

Thus unshare --pid --fork --mount-proc bash uses --fork to create the shell inside the new PID namespace. That shell is PID 1 there even if its host PID is 48213. PID 1 adopts orphaned processes; if it exits, the kernel kills the namespace's remaining processes. Processes in an ancestor namespace can see descendants, while processes inside cannot see outward into ancestor PID namespaces.

Separate files and networking

A mount namespace gives a private mount list. A runtime assembles a file tree and makes it the root using pivot_root. A container can use another Linux distribution's /etc and /usr while still calling the host kernel. chroot alone merely changes the starting point for path lookup; it is not a safe boundary against a privileged process.

A new network namespace has a loopback interface. A runtime can connect it through a veth pair, with one endpoint inside and another connected to a host bridge. Separate stacks let two containers both listen on port 80 without competing for one namespace's port.

Translate identities across a user namespace

A line in /proc/<pid>/uid_map lists the first inside ID, first outside ID and range length. The line 0 100000 65536 maps inside IDs 0–65535 onto host IDs 100000–165535. Inside UID 1000 therefore maps to 101000 outside. IDs without a usable mapping are normally displayed as the overflow UID 65534.

Root inside that namespace has capabilities over resources governed by it, not host-wide authority. Loading a kernel module or changing the real system clock still needs privilege in the initial user namespace. A UID mapping does not protect a privileged runtime socket handed into the container.

A private view also does not limit consumption. A process with its own PID and mount namespaces can still consume CPU and RAM. Cgroups limit amounts, while capability limits and seccomp restrict operations.

Key Takeaways

  • Containers use host-kernel processes with private resource views.
  • The eight namespace types separate different kinds of global state.
  • PID reassociation and unshare of time namespaces affect later children; setns can join a time namespace directly.
  • PID 1 has special lifecycle duties inside its namespace.
  • User namespaces translate IDs and scope authority.
  • Private views need separate resource and privilege limits.

5.2 Limit what a process uses with control groups

A control group, or cgroup, groups processes for resource accounting and control. Namespaces determine their view; cgroups govern quantities such as CPU time, memory and task count. Children inherit their parent's group, and the hierarchy prevents a child escaping an ancestor's limits.

Read the cgroup v2 files

Cgroup v2 uses one unified hierarchy, normally at /sys/fs/cgroup. A parent enables controllers for its children through cgroup.subtree_control, for example +cpu +memory +pids. Individual files in each child hold limits and counters.

Controllers include cpu, cpuset, memory, io, pids, hugetlb and rdma. They govern CPU time, placement on CPUs and memory nodes, ordinary memory, block I/O, task count, huge pages and RDMA resources. Cgroup-aware performance events support measurement, and cgroup.freeze pauses a group's execution.

Distinguish a CPU cap from a share

cpu.max contains quota and period in microseconds. 50000 100000 allows 50 ms of CPU execution per 100 ms, equivalent to half of one CPU. 200000 100000 allows two CPUs' worth of time, potentially spread across cores. max 100000 means no quota cap. Once the quota is consumed, the group waits for the next period even if a CPU is idle.

cpu.weight sets a relative share during competition, from 1 to 10,000 with default 100. For equally placed, runnable groups on four CPUs, weights 100 and 300 divide available time 1:3: approximately one CPU and three CPUs. If the heavier group goes idle, the other can use all four, unless another limit intervenes. A weight is not a reservation or hard ceiling.

Contain memory and task exhaustion

memory.high applies reclaim pressure and slows tasks above its threshold. memory.max imposes a hard boundary. The kernel first tries to reclaim memory, including cache and available swap. If it cannot recover enough, cgroup OOM handling kills an eligible process inside the affected group.

For memory.max of 512M, the limit is 536,870,912 bytes, or 512 MiB. A leaking process can force reclaim and eventually an OOM kill, but the victim is selected by the kernel and is not guaranteed to be that process. The group boundary contains the event instead of choosing an unrelated host process.

pids.max counts processes and threads. At a limit of 100, further creation fails with EAGAIN, containing a fork bomb's task growth. An I/O limit such as 8:0 rbps=10485760 in io.max caps reads from block device 8:0 at 10 MiB/s.

These files do not hide host processes or file names. Also, /proc/meminfo and tools reading it may report host RAM instead of memory.max; the displayed total alone does not prove a cgroup has no limit. Resource measurements must be read at the layer that enforces the boundary.

Key Takeaways

  • Cgroup v2 applies resource controls through a unified hierarchy.
  • A child remains constrained by ancestor limits.
  • cpu.max is a hard quota; cpu.weight is a relative share during competition.
  • memory.high applies pressure; memory.max can lead to a local OOM kill.
  • pids.max counts threads as well as processes.
  • Cgroup limits do not create private views of host resources.

5.3 Restrict containers and choose between containers and virtual machines

A useful container boundary combines views, resource controls and restricted authority. A private file tree alone does not stop dangerous system calls, and a CPU quota does not stop access to an exposed host file. The host kernel enforces every one of these controls.

Reduce the process's authority

A runtime combines namespaces, cgroups and a file-system image containing programs and libraries. It can strengthen the boundary by:

  • Running the workload as non-root or mapping container IDs through a user namespace.
  • Dropping Linux capabilities, especially broad powers such as CAP_SYS_ADMIN and CAP_SYS_MODULE.
  • Applying seccomp to restrict unnecessary calls.
  • Applying an SELinux or AppArmor policy.
  • Making the root file system read-only where practical.
  • Setting no_new_privs so setuid execution cannot raise privilege.

Each control covers a different route. A read-only root file system still allows permitted network operations; a seccomp filter still allows the calls on its list. The design should match the operations the application actually needs.

Identify shared-kernel risk

All ordinary containers share the host kernel. A reachable kernel bug can therefore compromise the host and other containers. In a VM, exploiting the guest kernel gives control of that guest; reaching the host requires a further hypervisor or device boundary failure.

Root inside a container is especially sensitive. Without a user namespace, it is UID 0 to the host kernel, constrained by capabilities, filters and mandatory policy. Privileged mode or access to the host root file system can remove those constraints. A root-owned runtime socket is also dangerous: its client can ask the runtime to perform privileged actions. Mapping container root to an unprivileged host ID does not make that socket safe or remove kernel vulnerabilities.

Choose a boundary for the workload
NeedSuitable boundaryReason
One team's frequently deployed Linux servicesRestricted containersFast starts and low overhead on one kernel
Mutually untrusted customer codeVMs or microVMsSeparate guest kernels reduce shared-kernel exposure
A Windows-only application on Linux hostsVMThe workload needs a different kernel

A Linux container needs a Linux kernel. Platforms on Windows and macOS therefore often provide a Linux VM beneath Linux containers. VMs boot an OS and allocate memory for each kernel; containers start ordinary processes and can pack workloads more densely.

Recognize intermediate designs

gVisor handles many container system calls in a user-space kernel, reducing direct contact with the host kernel. Kata Containers gives each sandbox, commonly a Kubernetes pod, a lightweight VM; containers in that sandbox share its guest kernel. Firecracker supplies microVMs with a minimal device model for platforms running functions or container workloads, including AWS Lambda.

Cloud systems often place containers inside VMs: a VM separates customers while containers organize one customer's applications. The guest kernels and the host kernel remain distinct, so a container escape inside a VM does not by itself prove a hypervisor escape.

Key Takeaways

  • Container isolation needs views, resource limits and privilege restrictions.
  • All ordinary containers on a host share its kernel.
  • A rootless UID mapping reduces authority but cannot fix kernel bugs.
  • Access to a privileged runtime socket can grant host control.
  • VMs can bring another kernel; containers use the kernel beneath them.
  • gVisor, Kata and Firecracker add different boundaries around workloads.
  • Containers inside VMs combine application density with separate guest kernels.

Operating System Protection examples

5 Walkthroughs

1

Follow a request across the kernel boundary

16 steps
Trace execution, argument checks, memory permissions and exploit defenses through a small service.
  1. 1
    IntroductionStart with a running application

    A report service spends most of its time calculating in user mode. It needs the kernel only for protected work, such as opening a file or arranging a mapping.

    Follow what changes when execution crosses that boundary: CPU privilege changes, but the caller’s identity and the validity of its request still need checking. Then follow the separate protections for memory, devices and executable code.

  2. 2
    ExplanationRun ordinary code directly

    The CPU executes the service’s additions, loads and jumps directly. Hardware checks privilege and memory permissions while it runs; the kernel does not approve each instruction in software.

    An attempt to replace a page table or disable interrupts must trap. Otherwise the program could remove the same restrictions that are supposed to contain it. This combination is limited direct execution.

  3. 3
    ChallengeA service stops making requests

    The service gets stuck in an endless user-mode loop. It never makes another system call. Can the scheduler still run a different ready process?

    ---reveal---

    Yes. A hardware timer interrupt enters the kernel independently of the service’s cooperation. The scheduler can select another process. Programming the timer and disabling interrupts require privilege, so the looping service cannot keep the core by avoiding system calls.

  4. 4
    ExplanationAsk for a protected service

    To read a file, the library wrapper places a call number, descriptor, buffer address and length in registers, then executes the architecture’s system-call entry instruction.

    The kernel saves user state, selects the handler and obtains the caller’s credentials from the current process. Entering with kernel privilege is only the start: the handler must still decide whether this caller and these arguments are allowed.

  5. 5
    ExampleInspect the complete destination

    Suppose the service asks read(fd, buf, 8192) to copy bytes into its buffer. The first byte being valid is insufficient: the copy may cross a page boundary into a forbidden range.

    The kernel must validate and safely access the entire destination needed for the transfer. Linux checked user-copy routines handle invalid user addresses without allowing the requested copy to overwrite kernel memory.

  6. 6
    ChallengeA request has the wrong kind of access

    The buffer is valid, but the service tries write() using a descriptor it opened with O_RDONLY. What should the kernel check, and must the process end?

    ---reveal---

    It checks the descriptor’s granted access and rejects the write with EBADF on Linux. This is an error result the program can handle. The call entered the kernel correctly, but the descriptor does not contain the requested right.

  7. 7
    Key InsightKeep a checked path tied to its object

    A helper checks permission on a path and later opens it with greater privilege. Between the two operations, another process can replace the directory entry. A copied path string does not prevent that replacement.

    This is a TOCTTOU race. Open under the intended credentials and use an object-acquisition strategy that checks what is actually opened; use O_NOFOLLOW when symbolic links are unwanted.

  8. 8
    ExplanationLet mappings govern later access

    Once a mapping is granted, loads and stores use the MMU without a system call per byte. The MMU checks the active page table’s write, user/supervisor and execute permissions.

    A read-only user page protects its contents from changes but still lets the process read them. To keep data secret from that process, the mapping must also deny reads, for example by being absent or supervisor-only.

  9. 9
    ExampleInterpret two read-only write faults

    The service writes first to its code page, then to data shared after fork(). Both pages are read-only, so both stores initially fault.

    The kernel’s records separate the outcomes. An unauthorized code write normally leads to SIGSEGV. A valid copy-on-write data fault leads to a private copy and a restarted instruction. The hardware reports the violation; kernel bookkeeping decides whether it can be repaired.

  10. 10
    ChallengeA device crosses the memory boundary

    The service is confined by CPU page tables, but a faulty device writes directly to unrelated RAM. Why did those CPU mappings not stop it?

    ---reveal---

    DMA does not pass through the CPU’s MMU. The device needs an IOMMU mapping that restricts its own addresses. Protecting CPU loads and stores is one boundary; confining device-originated transfers requires the corresponding device boundary.

  11. 11
    ExplanationBlock execution of injected bytes

    A buffer overflow can overwrite a saved return address. Marking the stack NX makes injected stack instructions non-executable, so a jump there faults.

    W^X adds the rule that no page may be writable and executable at once. A just-in-time compiler must write generated code, then switch permissions before executing it. These checks constrain exploitation while leaving the original out-of-bounds write to be fixed.

  12. 12
    ConnectionMake existing code hard to locate

    An attacker can reuse instructions already in executable libraries instead of injecting new instructions. ROP links these short gadgets into a new computation.

    ASLR makes their addresses harder to predict. A leak of a known library address reveals that library’s base and known offsets, but does not reveal an independently randomized stack. Randomization works best when bugs cannot disclose its chosen addresses.

  13. 13
    ChallengeContain a compromised renderer

    A renderer has been exploited. Its stack is NX and its library addresses are now known to the attacker. A seccomp policy still blocks program-launch calls. Can code reuse simply remove that restriction?

    ---reveal---

    No. Reusing executable instructions does not remove an installed seccomp filter. The process remains limited to permitted calls, so launching another program needs a further way around the filter or another boundary failure.

  14. 14
    ExplanationSeparate startup checks from event records

    Secure boot verifies signatures before handing control to the next trusted startup component. Measured boot records component hashes, often using a TPM, so an external verifier can assess what loaded.

    Audit logging serves a later purpose: it records events such as failed logins and elevated commands. Protecting copies outside the host helps preserve that evidence if an intruder gains authority to erase local logs.

  15. 15
    ChallengeChoose the missing protection layer

    A root service maps sensitive data read-only into an untrusted worker and restricts the worker’s system calls. The worker then reads the data. Which decision exposed it?

    ---reveal---

    The user-readable mapping exposed the contents. Read-only protects against changes, and a syscall filter does not block ordinary loads from an allowed page. The kernel must deny the worker that mapping or its read permission to preserve confidentiality.

  16. 16
    RecapLocate the check that governs the action

    For an unfamiliar failure, follow the operation: CPU instruction, kernel request, mapped memory access or device DMA. Each reaches a different enforcement point.

    Then ask what the attacker already controls. Root identity, executable gadgets and a valid descriptor confer different powers. A useful diagnosis names the exact missing check instead of assuming that one successful defense protects every path.

2

Follow login into process credentials

14 steps
Connect password verification and other factors to the identity a running program actually carries.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionTurn a login into a running identity
  2. 2
    ExplanationInstall groups before giving up root
  3. 3
    ExampleFollow a setuid password helper
  4. 4
    ChallengeUpdate an account during a session
  5. 5
    ExplanationRecompute a verifier without recovering a password
  6. 6
    ExampleMeasure one account’s guessing work
  7. 7
    ExampleRepeat the work for different salts
  8. 8
    ChallengeA lockout does not reach the stolen file
  9. 9
    ExplanationDistinguish a code from a site-bound signature
  10. 10
    ExampleChoose the denominator before calculating
  11. 11
    ChallengeTwo secrets are still one factor type
  12. 12
    ConnectionLet the kernel identify a local peer
  13. 13
    ChallengeFind where login strength stops mattering
  14. 14
    RecapKeep the proof and the resulting rights distinct
3

Work through an access decision

15 steps
Use credentials, directory operations and policy together to explain an access result.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionName the operation and its object
  2. 2
    ExplanationArrange rights by object or by subject
  3. 3
    ExamplePass a narrow grant to a worker
  4. 4
    ChallengeChange permissions after granting a handle
  5. 5
    ExplanationSelect a class before adding its bits
  6. 6
    ExampleCreate a file under a mask
  7. 7
    ExampleTest access using the resulting mode
  8. 8
    ChallengeRemove a name without reading its data
  9. 9
    TipRead the ACL limit as well as the entry
  10. 10
    ExplanationAdd a policy the owner cannot waive
  11. 11
    ExampleFollow confidential information between levels
  12. 12
    ChallengeExplain a root service’s denied read
  13. 13
    ConnectionChange a job through roles
  14. 14
    ChallengeFollow a grant through several controls
  15. 15
    RecapTrace the decision in a useful order
4

Run a guest without surrendering the host

17 steps
Follow CPU interception, page translation and device handling across a virtual machine boundary.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionGive a kernel its own apparent computer
  2. 2
    ExplanationSchedule a virtual processor
  3. 3
    ChallengeJudge a consolidation claim
  4. 4
    ExplanationEmulate only the guest’s control state
  5. 5
    ExampleRepair an instruction that does not trap
  6. 6
    ChallengeKeep guest ring 0 under control
  7. 7
    ExplanationSeparate the three address names
  8. 8
    ExampleApply the guest’s mapping first
  9. 9
    ExampleApply the hypervisor’s mapping next
  10. 10
    ChallengeTranslate a different byte in the page
  11. 11
    ConnectionChoose where the combined mapping is maintained
  12. 12
    Key InsightReclaim with help from the guest
  13. 13
    ExplanationTrade device compatibility for fewer transitions
  14. 14
    ChallengeReduce frequent device exits
  15. 15
    ExplanationProtect a boundary larger than page mappings
  16. 16
    ChallengePrepare a live machine for another host
  17. 17
    RecapKeep control at every virtual interface
5

Build and assess a container boundary

16 steps
Combine namespace views, resource budgets and privilege restrictions, then choose a suitable isolation layer.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionSeparate three jobs inside a container
  2. 2
    ExplanationGive processes private resource views
  3. 3
    ExampleStart the first child in a PID namespace
  4. 4
    ExampleMap an inside identity to the host
  5. 5
    ChallengeChoose the view that resolves a conflict
  6. 6
    ExplanationRead a hard CPU budget
  7. 7
    ExampleDivide a parent budget between children
  8. 8
    ChallengeLet a competing group go idle
  9. 9
    ExplanationContain memory and task growth
  10. 10
    ChallengeRead the limit at the enforcing layer
  11. 11
    ExplanationReduce what the process may ask for
  12. 12
    ChallengeA mapped UID still reaches a privileged service
  13. 13
    ConnectionChoose where a separate kernel belongs
  14. 14
    ExplanationRecognize added sandbox layers
  15. 15
    ChallengePlace untrusted jobs with resource limits
  16. 16
    RecapMatch each need with its mechanism

Operating System Protection practice questions

60 Practice Questions in 6 sets

Set 1: Follow hardware and kernel boundaries10 Practice Questions

Question 1 of 10

A root-owned calculator is adding two integers in its main function. In what CPU mode does this application code normally run?
  1. Kernel mode.
  2. VMX root mode.
  3. User mode.
  4. Root mode.
Show answerHide answer
Answer: C
Root is a credential used by kernel access checks; it does not change the execution mode of ordinary application code. The addition runs directly in user mode. Entering kernel mode requires a controlled event such as a system call, fault or interrupt, even for a root-owned application.

Question 2 of 10

A user process tries to install a replacement interrupt table with x86 LIDT. What prevents it from taking control of interrupt handling?
  1. The scheduler rejects its next time slice.
  2. The CPU traps on the privileged instruction.
  3. The C library rewrites the table address.
  4. The page cache discards its table contents.
Show answerHide answer
Answer: B
Installing the real interrupt table is privileged, so the processor traps when user-mode code tries it. The registered kernel handler receives control before the requested replacement can occur. A library check would be insufficient because machine code can execute without going through that library.

Question 3 of 10

A process repeatedly jumps to its own code and makes no system calls. How can another ready process still receive CPU time?
  1. Its next system call automatically selects the other process.
  2. User-mode jumps lose privilege after enough repetitions.
  3. The MMU counts jumps and eventually invalidates the code page.
  4. A timer interrupt enters the kernel, which can reschedule.
Show answerHide answer
Answer: D
The hardware timer gives the kernel an entry path independent of voluntary system calls. Its interrupt lets the scheduler select another ready process. Waiting for the looping program to call the kernel would fail here, and user code cannot disable the privileged timer mechanism to prevent preemption.

Question 4 of 10

A program opens a file read-only and later calls write() through that descriptor. Which Linux error fits the missing descriptor access?
  1. EBADF.
  2. EFAULT.
  3. EACCES.
  4. EAGAIN.
Show answerHide answer
Answer: A
The descriptor was opened without write access, so write() rejects its use with EBADF. EACCES commonly describes an access-control denial while acquiring access, but this failure is about the mode of an already open descriptor. EFAULT would instead identify a bad user-memory address.

Question 5 of 10

A privileged export helper checks a path, pauses, then opens it. Another process replaces the path during the pause. What change addresses the race?
  1. Check the path twice before opening under full privilege.
  2. Copy the path text and keep the original separate check.
  3. Increase the login delay before starting the helper.
  4. Open the actual object under the intended reduced credentials.
Show answerHide answer
Answer: D
The permission decision must cover the object actually opened under the intended credentials. Repeating the earlier check still leaves a window for replacement before the privileged open. Keeping an unchanged copy of the path string also does not keep the file-system object behind that name unchanged.

Question 6 of 10

A kernel handler trusts a caller-supplied user name, validates a buffer’s first byte, and then copies a caller-supplied length into it. What complete repair is needed?
  1. Use kernel-held credentials and validate only the destination’s first page.
  2. Use kernel-held credentials and validate the full destination range.
  3. Trust the user name after checking the full destination range.
  4. Keep the name check and copy using a kernel-mode instruction.
Show answerHide answer
Answer: B
Two independent trust errors are present: the client supplies its claimed identity and its memory range. The handler must use authenticated kernel credentials and validate the entire destination implied by address and length. Checking only the first page can leave later bytes outside the permitted range.

Question 7 of 10

A store to a read-only data page faults after fork(). The kernel records mark it copy-on-write. What response preserves normal program behavior?
  1. End the process because every read-only write is fatal.
  2. Make the shared physical page writable for both processes.
  3. Create a private writable copy and retry the store.
  4. Return EACCES as the result of the store instruction.
Show answerHide answer
Answer: C
The read-only state is intentional copy-on-write bookkeeping, so the kernel can copy the page, update this process’s mapping and retry. Making the original shared page writable would let the write affect the other process. A fault alone does not decide whether recovery is possible; the mapping records do.

Question 8 of 10

A process has a read-only executable code page with no copy-on-write status and a read-only copy-on-write data page shared after fork(). Stores to both fault. A driver also needs DMA into a separate buffer. Which response preserves the intended boundaries?
  1. Keep code protected, privately copy the written data, and confine DMA with an IOMMU.
  2. Keep code protected, privately copy the written data, and confine DMA using only the CPU MMU.
  3. Keep code protected, make the shared data writable in place, and confine DMA with an IOMMU.
  4. Permit code writes after the fault, privately copy the data, and confine DMA with an IOMMU.
Show answerHide answer
Answer: A
The code write is invalid, while the data fault should create a private writable copy so the other process’s data stays unchanged. The device needs an IOMMU because DMA bypasses the CPU MMU. Making every faulting page writable would remove intended code protection and mishandle the shared data.

Question 9 of 10

An attacker redirects execution into injected bytes on a stack page marked NX. What immediate protection applies?
  1. The injected bytes are erased first.
  2. Instruction fetch from that page faults.
  3. The page moves to a random physical frame.
  4. The effective UID drops to an ordinary user.
Show answerHide answer
Answer: B
NX forbids execution from the marked page, so the attempted instruction fetch faults. It does not erase the bytes or repair the original overflow. ASLR addresses a different issue by making addresses harder to predict; it is not the page permission that blocks this particular jump.

Question 10 of 10

A leak reveals an address inside a known shared library. The stack is randomized independently. What can an attacker infer from the leak?
  1. The library base and known gadget offsets, but not the stack base.
  2. Both the library base and the independent stack base.
  3. Only the leaked byte, because offsets change within the library.
  4. The stack base, but no other addresses inside the library.
Show answerHide answer
Answer: A
For a known library layout, subtracting the leaked symbol’s offset reveals the base and therefore other known offsets in that library. Independent stack randomization is not resolved by that calculation. Treating one address leak as a complete defeat of every randomized region assumes a relationship the question does not give.
Set 2: Trace identities and authentication10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Two local account names have UID 2400. How does the Unix kernel distinguish their file-owner identity?
  1. It compares the spelling of their login names.
  2. It gives each a new UID when the shell starts.
  3. It compares their password-hash algorithms.
  4. It treats both as the same numeric user identity.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A login helper permanently changes from UID 0 to UID 2400 before replacing its supplementary groups. Why is this order unsafe?
  1. It may lose the authority needed to replace privileged groups.
  2. It changes all existing files to the user’s primary group.
  3. It makes the user’s real UID become the old group ID.
  4. It grants the user permission to set any group thereafter.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Nora is added to the archive group while her terminal remains open. Why can a command started from that terminal still fail an archive-group check?
  1. The file owner must rename the archive group first.
  2. It inherits the terminal’s old process group list.
  3. Only the real UID can record a supplementary group.
  4. New children always discard supplementary groups.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A stolen password database contains a different random salt beside every hash. Must the salts be hidden for their main protection to work?
  1. Yes; they are the decryption keys for the passwords.
  2. Yes; a public salt makes every stored hash reversible.
  3. No; they prevent reusable hashing work even when public.
  4. No; the salt itself replaces the user’s password secret.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A test space has 81,000,000 equally possible passwords. An offline attacker checks 3,000 per second. How long does exhausting the space take?
  1. 13,500 seconds.
  2. 27,000 seconds.
  3. 243,000 seconds.
  4. 270,000 seconds.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A service adds a unique public salt per account and an online lockout, but keeps a single fast hash. Its verifier database is stolen. What protection remains missing?
  1. An expensive password-hashing scheme for each offline guess.
  2. A second online lockout applied to the stolen database.
  3. Encryption that lets the service recover forgotten passwords.
  4. A common salt hidden in the public account-name file.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A password-only service follows NIST SP 800-63B-4. What policy fits its minimum-length and routine-change guidance?
  1. At least 8 characters, with a forced change every calendar month.
  2. At least 12 characters, with one symbol required in every password.
  3. At least 15 characters, with a forced change after evidence of compromise.
  4. At least 15 characters, with a forced change at every successful login.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A login asks for a password and then a PIN remembered by the user. How many factor types does this use?
  1. Two: plus possession.
  2. One: identity.
  3. Two: one per screen.
  4. One: knowledge.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

In a biometric test, 6 of 30,000 impostor attempts succeed and 18 of 900 genuine attempts fail. What are FAR and FRR?
  1. FAR 0.02%; FRR 2%.
  2. FAR 2%; FRR 0.02%.
  3. FAR 0.02%; FRR 0.06%.
  4. FAR 0.2%; FRR 20%.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

An attacker steals a service’s verifier database and operates a fake site that previously relayed fresh TOTP codes. The service replaces that login with FIDO2. Can stored public keys or responses obtained for the fake site supply a valid signature for the real site?
  1. Public keys can sign new challenges, but fake-site responses are not valid for the real site.
  2. Neither suffices: public keys cannot sign, and fake-site responses are not valid for the real site.
  3. Public keys cannot sign, but a fresh fake-site response can be relayed like a TOTP code.
  4. Both suffice while a challenge is fresh, because time rather than site identity controls acceptance.
Show answerHide answer

Save this lesson to see this answer.

Set 3: Decide who can use a resource10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

An administrator wants to review everyone allowed to read one database object. Which representation directly groups those rights together?
  1. Each user’s capability list.
  2. The database object’s ACL.
  3. The scheduler’s run queue.
  4. Each process’s page tables.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A worker inherits a writable descriptor for metrics.bin. The owner then removes write permission from the file’s mode. What happens to ordinary writes through that descriptor?
  1. They can continue under the access granted at open.
  2. They fail as soon as the next mode check sees no write bit.
  3. They continue only if the worker becomes the file owner.
  4. They reopen the path automatically with the worker’s UID.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A supervisor must give a worker read access to one already open input file, allow no pathname search, and retain all its own other rights. Which design most directly fits?
  1. Share the supervisor’s complete account credentials.
  2. Add the worker to the input directories’ group.
  3. Pass a read-only object capability to the worker.
  4. Grant a Linux privilege bypassing file access checks.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

What rights does Unix mode 652 give the owning group?
  1. Read and write.
  2. Write only.
  3. Read only.
  4. Read and execute.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Mina owns a file with mode 046. Ignoring ACLs and privileged overrides, can she read it through the owner check?
  1. Yes, because the group class grants read.
  2. No, because the owner class has no rights.
  3. Yes, because the others class grants read.
  4. Yes, because all three classes are combined.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A program requests mode 666 for a new file under umask 037. What mode results?
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Omar has ordinary write and execute rights on Leena’s sticky directory. A mode-000 file inside also belongs to Leena. Omar is neither owner and has no override. Can he read or delete it now, and could he delete it if the sticky bit alone were removed?
  1. No read now, but deletion is already possible and remains possible after the bit is removed.
  2. Read and deletion are both possible now because the directory grants write and execute.
  3. Neither action is possible now, and mode 000 still prevents deletion after the bit is removed.
  4. No read or deletion now; deletion becomes possible after the sticky bit is removed.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A root service’s Unix checks allow a read, but enforcing SELinux denies its domain access to the file’s type. What is the result?
  1. UID 0 overrides the SELinux denial.
  2. The earlier DAC check allows the read.
  3. The read is denied by mandatory policy.
  4. The read is logged but still allowed.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A Secret process needs to send Secret notes to Confidential storage. It can write directly, or ask a Confidential helper to read its Secret-labeled buffer and then write the storage. Under Bell–LaPadula, what happens to these two paths?
  1. Only the direct write fails; the helper may read upward before writing at its own level.
  2. Only the helper path fails; the Secret process may write any destination it can read.
  3. Both fail: the direct write is downward, and the helper’s read is upward.
  4. Both succeed because the final destination is writable by the Confidential helper.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A company manages 72 staff with 24 permissions each. Six non-overlapping job roles each contain 24 permissions; every person has one role. How many assignments does this RBAC design need, and why?
  1. 216: 72 user-role links plus 144 role-permission links.
  2. 144: only the six sets of role-permission links matter.
  3. 1,728: each user must still receive every permission directly.
  4. 288: 72 user-role links plus 216 role-permission links.
Show answerHide answer

Save this lesson to see this answer.

Set 4: Trace a guest through virtual hardware10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A virtualization application relies on an ordinary host OS to own the hardware. Which hypervisor design is this?
  1. Type 1, native.
  2. Container-based.
  3. Type 2, hosted.
  4. Passthrough-based.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Eight equally sized servers average 7% CPU use each. What can their combined average tell a consolidation planner?
  1. They average 56%, so one host is guaranteed to handle all future demand.
  2. They average 7%, because simultaneous guests share the same physical cores.
  3. They average 87.5%, so memory and device demand need no further checks.
  4. They average 56% of one equivalent machine, but peaks still need headroom.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Under Intel VT-x, a guest kernel is executing at ring 0 in VMX non-root operation. Does that ring number give it the hypervisor’s hardware authority?
  1. No; VMX root operation remains a separate control layer.
  2. Yes; every ring-0 instruction belongs to the host kernel.
  3. Yes; non-root operation only changes the guest’s UID.
  4. No; ring 0 is the least privileged x86 protection ring.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A classic deprivileged guest instruction silently leaves an interrupt flag unchanged instead of trapping. Why is simple trap-and-emulate insufficient?
  1. The instruction is too computationally expensive to run directly.
  2. The hypervisor receives no event to emulate the guest’s intended change.
  3. The guest must first translate the flag through nested page tables.
  4. The hypervisor has already surrendered the physical interrupt table.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A guest cannot be modified and the available CPU lacks suitable virtualization assistance. Its kernel uses sensitive instructions that do not trap. Which approach can preserve guest behavior while retaining control?
  1. Run the guest kernel directly at full host privilege.
  2. Replace those instructions with hypercalls in its source code.
  3. Use nested page tables to make every CPU instruction trap.
  4. Translate problematic guest kernel instructions before execution.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

With 4 KiB pages, guest virtual page 5 maps to guest frame 12, which maps to machine frame 29. What machine address corresponds to 0x53D0?
  1. 0x1D3D0.
  2. 0xC3D0.
  3. 0x1D53D0.
  4. 0x533D0.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A VM uses hardware nested paging with three guest page-table levels and four hypervisor levels. On a fully uncached translation, how many page-table memory references are needed before the data access, and must each guest page-table edit trap for shadow synchronization?
  1. 7 references; hardware nesting does not require shadow synchronization on every edit.
  2. 19 references; every guest table edit must trap to synchronize a software shadow.
  3. 19 references; hardware nesting does not require shadow synchronization on every edit.
  4. 24 references; every pair of nested tables has the same walk length regardless of depth.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A host overcommits memory among separate customers. Each guest knows which data it can discard, and cross-customer page sharing is disallowed. Which reclaim strategy uses that knowledge, and what if all guests later need their full promised memory?
  1. Use blind host swapping; it directly knows which guest pages are free and avoids pressure at full demand.
  2. Use ballooning; it still cannot provide all promised RAM if combined active demand exceeds the host.
  3. Use ballooning; it permanently increases host capacity enough to honor every promised allocation.
  4. Use identical-page merging; it honors the sharing restriction because merged pages begin read-only.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A guest storage driver places many requests into a shared-memory queue before notifying a backend. Which device model does this illustrate?
  1. A register-by-register emulated device.
  2. A paravirtual device interface.
  3. A physical device shared without mediation.
  4. A CPU instruction-set emulator.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

VMs have correct private page mappings, but an attacker infers data through a shared cache’s timing. The operator considers CPU microcode updates and avoiding different customers on sibling hardware threads. Which diagnosis connects the exposure to those controls?
  1. A shared-hardware side channel needs CPU mitigations and careful sibling-thread placement.
  2. A device-model escape needs only patched emulation; cache timing cannot cross correct guest mappings.
  3. A shared-cache side channel needs CPU updates alone; updates remove every sibling-thread risk.
  4. A shared-cache side channel needs thread separation alone; CPU vulnerabilities then need no updates.
Show answerHide answer

Save this lesson to see this answer.

Set 5: Interpret container views and limits10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A service needs its own interfaces, routing table and listening-port space. Which Linux namespace provides that view?
  1. Network.
  2. Mount.
  3. PID.
  4. Cgroup.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A UID mapping is 0 220000 8000. What host UID corresponds to inside UID 1750?
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A supervisor calls unshare(CLONE_NEWPID), creates its first child there, and stays alive outside. That child creates a logger and then exits. What happens to the logger and supervisor?
  1. The logger survives as PID 1, and the supervisor moves into the child’s namespace.
  2. The logger survives in the host namespace, and the supervisor keeps its old membership.
  3. The logger is killed, and the supervisor is killed because both share the same kernel.
  4. The logger is killed, and the supervisor remains in its original PID namespace.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A group has cpu.max of 120000 100000. What CPU allowance does that encode?
  1. 0.12 CPUs’ worth of time per period.
  2. 1.2 CPUs’ worth of time per period.
  3. 12 CPUs’ worth of time per period.
  4. A relative scheduling weight of 1.2.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Two peer groups with enough runnable threads compete on six equally available CPUs. Their weights are 200 and 400, with no quotas. What share does the first receive, and what if the second becomes idle?
  1. About two CPUs under contention; it remains capped at two when alone.
  2. About two CPUs under contention; it may use all six when alone.
  3. About three CPUs under contention; it may use all six when alone.
  4. About four CPUs under contention; it remains capped at four when alone.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A parent caps two busy children at 1.5 CPU equivalents. Child A has weight 100 and its own 0.5-CPU quota; B has weight 200. A should keep its one-third share during contention but borrow all available parent capacity when B is idle. Which change fits?
  1. Remove A’s own quota while retaining both weights and the parent cap.
  2. Raise A’s weight to 300 while retaining its own quota and the parent cap.
  3. Raise only the parent cap while retaining A’s own quota and both weights.
  4. Give B a smaller quota while retaining A’s own quota and both weights.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A parent has pids.max of 30. Child group A has four processes with seven total threads each and a local limit of 40; sibling group B holds two single-threaded processes. Can A create another thread while every existing task remains alive?
  1. Yes; A is below its local limit of 40, so the parent’s total does not matter.
  2. Yes; the parent counts only the six process leaders, leaving 24 task slots.
  3. No; A’s 28 tasks plus B’s 2 already fill the parent’s 30-task limit.
  4. No; A already exceeds its local limit because each process adds seven extra leaders.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A team wants to run an application requiring a Windows kernel on Linux servers. What boundary can supply that kernel?
  1. A Windows container.
  2. A UID 0 namespace.
  3. A mounted Windows tree.
  4. A VM running Windows.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A rootless container receives a usable socket to a root-owned host runtime. Why can the UID mapping fail to protect the host from its requests?
  1. The mapped UID gives the runtime’s requests only the container’s reduced authority.
  2. The mapping blocks privilege changes in the client, so requests cannot affect host objects.
  3. The runtime acts with its own privileged authority on requests the client can submit.
  4. The socket permits only namespace-local actions because its client is in a user namespace.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A provider runs uploaded code for unrelated customers. Customers A and C need Linux; B needs Windows. It wants fast container deployment within each customer environment while keeping a guest-kernel compromise within that customer. How should it arrange the boundaries?
  1. Use a separate VM or microVM per customer, with the needed OS and compatible containers inside.
  2. Use one VM per OS, mixing A and C’s containers in Linux and placing B in a Windows VM.
  3. Use one shared Linux VM with separate rootless containers and give B a Windows file tree.
  4. Use one shared Windows VM with separate PID namespaces and package all three customers’ libraries.
Show answerHide answer

Save this lesson to see this answer.

Set 6: Diagnose failures across isolation layers10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

An investigator needs records of failed logins and uses of elevated commands. Which mechanism supplies that evidence?
  1. Address randomization.
  2. Audit logging.
  3. Nested paging.
  4. A CPU execution quota.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A biometric system accepts too many impostors. The operator raises its similarity threshold. What tradeoff should testing look for?
  1. More impostor accepts and fewer genuine-user rejects.
  2. Fewer impostor accepts and fewer genuine-user rejects.
  3. More impostor accepts and more genuine-user rejects.
  4. Fewer impostor accepts and more genuine-user rejects.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A POSIX ACL gives a named user read and write, but its mask is read-only. The file’s others entry has write. The user is not the owner. Can the named user write through a new open?
  1. No; the named entry is capped by the mask and cannot fall through to others.
  2. Yes; the named read-write entry bypasses the group-class mask.
  3. Yes; others write is combined with the masked named entry.
  4. No; every named user needs to join the owning group before using an ACL.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A privileged helper copies a pathname into private memory, checks it with access(), then opens that path with full privilege. An attacker can replace the named entry. Which flaw remains?
  1. Copying the string has removed both the memory race and the path race.
  2. The copy changes the helper’s real UID to match the path’s owner.
  3. The stable string can still resolve to a different object at open time.
  4. The copy makes symbolic links invisible to all later name lookups.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

With 4 KiB pages, a guest maps virtual page 9 to guest frame 4, then machine frame 51. An assigned device is also allowed machine frames 48–55 by its IOMMU. What is the CPU address for 0x9B20, and is that resulting frame inside the device mapping?
  1. 0x4B20; no, frame 4 is outside the allowed range.
  2. 0x33B20; no, the offset is outside the allowed range.
  3. 0x33B20; yes, frame 51 is in the allowed range.
  4. 0x9B20; yes, the virtual page number is in the allowed range.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

An eight-CPU host gives a parent cgroup a two-CPU quota. Two runnable peer children have weights 100 and 300, no smaller quotas and enough parallel work. What sustained shares follow while both compete?
  1. About 2 and 6 CPUs from all eight host CPUs.
  2. About 0.5 and 1.5 CPUs within the parent’s cap.
  3. About 1 and 1 CPUs with the quota split equally.
  4. About 2 and 2 CPUs with a full quota each.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A supervisor opens a file, passes a read-only descriptor to a worker and then changes the file’s mode to deny that worker future opens. What authority does the worker still have through the descriptor?
  1. It retains read access through the existing descriptor.
  2. It loses the descriptor at the next scheduler switch.
  3. It gains write access because descriptors ignore access modes.
  4. It may reopen any sibling file through that file descriptor.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A VM uses passthrough for a DMA-capable card and hardware-encrypted guest memory. The operator wants live migration and confinement of device access to the correct VM. Which work is still required?
  1. Use the IOMMU, but migrate only the disk and skip the assigned device’s state.
  2. Transfer device state, but restrict its DMA with guest page tables alone.
  3. Let memory encryption replace DMA confinement and copy only CPU state.
  4. Confine DMA with an IOMMU and handle the assigned device’s migration state.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A container has a new PID namespace but shares the host network namespace. Can its PID isolation alone let it bind a port already occupied on the host?
  1. No; the port remains in the shared network namespace.
  2. Yes; every PID namespace has an independent port space.
  3. Yes; PID 1 automatically receives a new network stack.
  4. No; containers can never bind network ports.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

An attacker enters a container in customer A’s VM and exploits a bug to control that VM’s guest kernel. Other customers have separate VMs on the same physical host. Which workloads are directly exposed, and what remains before host execution?
  1. Only the original container is exposed; its PID namespace still confines the controlled guest kernel.
  2. Other containers in A’s VM are exposed; host execution still requires crossing the VM boundary.
  3. All customers’ VMs are directly exposed; any guest kernel controls the shared physical host.
  4. Only containers with the same UID are exposed; a controlled guest kernel must still obey each UID.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

113 Key Terms, each with its definition

A

Access control entry
An access control entry is an individual Windows ACL rule naming a SID and the rights to allow, deny or audit.
An access control entry denying write to an applicable group can stop a request that includes write access.
Access control list
An access control list stores the subjects and rights associated with an object, corresponding to one access-matrix column.
A report’s access control list can give one account write access and a second account read access.
Access matrix
An access matrix represents allowed operations with one subject per row, one object per column and rights in each cell.
An access matrix can show that a backup process may read a report but has no right to use a printer.
Access token
An access token is a Windows credential object containing user and group SIDs and privileges used during access checks.
UAC starts an administrator’s ordinary program with a filtered access token before any approved elevation.
AppArmor profile
An AppArmor profile confines a program by specifying allowed paths and operations, including selected Linux capabilities.
An AppArmor profile can allow a service to read its configuration but deny access to unrelated home files.
ASLR
ASLR randomizes memory-region locations so attackers cannot reliably predict addresses for code reuse or data targeting.
An information leak can reveal one library’s base address and undermine ASLR for that library’s gadgets.
Audit log
An audit log records security-relevant events so administrators can detect misuse and reconstruct what happened.
A protected remote audit log can retain a privileged command record after an attacker erases local files.
Authentication
Authentication checks that an entity claiming an identity controls the credentials or factors associated with that identity.
A successful authentication lets the login service attach the account’s credentials to a new shell.
Authorization
Authorization decides whether an authenticated principal may perform a particular operation on a protected resource.
File authorization can refuse a logged-in user permission to read a report belonging to another account.

B

Ballooning
Ballooning uses a guest driver to reserve pages so the hypervisor can reclaim their machine frames with guest cooperation.
Ballooning lets the guest choose which pages to give up using knowledge the hypervisor does not have.
Bell–LaPadula model
The Bell–LaPadula model protects confidentiality by forbidding reads above a subject’s level and writes below it.
Under the Bell–LaPadula model, a Secret process may read Confidential data but may not write to a Confidential file.
Binary translation
Binary translation rewrites problematic guest kernel instructions into safe sequences before running and caching the result.
Binary translation can support an unmodified guest kernel on a processor with sensitive instructions that do not trap.
Biometric template
A biometric template is stored feature data derived from a physical trait and used for similarity-based identity matching.
A fingerprint sensor compares new features with a biometric template instead of requiring identical images.
Brute-force attack
A brute-force attack systematically tries every candidate in a defined password space until it finds a matching verifier.
A brute-force attack on eight lowercase letters has a search space of 26 to the eighth power.
Buffer overflow
A buffer overflow is a write past a buffer’s bounds that can corrupt nearby data, including a saved control-flow address.
A stack buffer overflow can replace a return address even though the intended operation only copied text.

C

Capability revocation
Capability revocation withdraws previously granted token-based access, potentially requiring control over delegated copies.
Capability revocation is difficult when many processes hold independently usable copies of an object’s grant.
Cgroup controller
A cgroup controller measures or regulates one resource class for groups in the control-group hierarchy.
A parent enables the memory cgroup controller for its children before configuring their memory boundaries.
Confidential computing
Confidential computing uses hardware protection and attestation to shield guest memory from a potentially untrusted host.
Confidential computing can keep VM memory keys unavailable to the hypervisor while hardware verifies the launch state.
Container
A container is one or more host-kernel processes isolated with private views, resource controls and privilege restrictions.
A container can carry another Linux distribution’s files while still running on the same kernel as the host.
Container runtime socket
A container runtime socket is an interface for controlling a runtime, whose authority can expose host-wide privileged operations.
Access to a root-owned container runtime socket can defeat the protection expected from an unprivileged UID mapping.
Control group
A control group organizes processes hierarchically for resource measurement and control, with inherited ancestor restrictions.
A control group can cap a batch job’s CPU use without hiding the host’s process names from it.
cpu.max
cpu.max is the cgroup v2 file that specifies a CPU execution quota and period in microseconds, or an unlimited quota.
A cpu.max value of 75000 100000 permits at most three quarters of one CPU’s time per period.
cpu.weight
cpu.weight sets a cgroup’s relative CPU share during contention without imposing a hard ceiling on otherwise available time.
A larger cpu.weight favors a busy group over competing peers but cannot override its separate quota.

D

DACL
A DACL is a Windows object’s ordered list of allow and deny entries that determines which requested rights are granted.
A DACL can grant a requested read through an explicit entry before evaluation reaches an inherited denial.
Device emulation
Device emulation presents a software model of physical hardware so a guest can use a driver for that device.
Device emulation can translate a guest network-card register write into work performed by a host helper.
Device passthrough
Device passthrough assigns a physical device or function directly to a VM, with an IOMMU restricting its DMA access.
Device passthrough can improve network performance while making sharing and live migration more difficult.
Dictionary attack
A dictionary attack guesses likely passwords, including leaked choices and predictable variations, before less likely strings.
A dictionary attack may find "Winter2027!" early despite its mixture of letters, digits and punctuation.
Direct memory access
Direct memory access lets a device transfer data to or from RAM without sending those accesses through the CPU’s MMU.
A network device using direct memory access needs a separate boundary around the RAM addresses it can reach.
Directory traversal
Directory traversal is lookup through a directory to reach an entry, requiring execute permission on that directory.
Directory traversal can allow opening a known name even when read permission does not allow listing all names.
Discretionary access control
Discretionary access control lets an object’s owner decide which other principals may access it and with what rights.
Discretionary access control lets a file owner grant read access, including through a program running as that owner.

E

EFAULT
EFAULT is a Linux error indicating that an address supplied for a system-call memory access is not a valid permitted user address.
A read() call with a destination in kernel memory can return EFAULT instead of overwriting the kernel.
Effective UID
The effective UID is the Unix process identity used for most access checks and can differ from the identity that started it.
A root-owned setuid password helper has effective UID 0 while retaining the caller’s real UID.
Exception level
An exception level is an ARMv8-A execution privilege level, ranging from EL0 applications to EL3 secure firmware.
The ARM hypervisor runs at exception level EL2 while a guest operating-system kernel normally runs at EL1.

F

False acceptance rate
The false acceptance rate is the fraction of impostor attempts that a biometric system incorrectly accepts as genuine.
One accepted impostor among 5,000 attempts gives a false acceptance rate of 0.02%.
False rejection rate
The false rejection rate is the fraction of genuine attempts that a biometric system incorrectly refuses to accept.
A stricter similarity threshold increases the false rejection rate when more genuine scans miss the cutoff.
File descriptor
A file descriptor is a process-local index to an open kernel-held resource with recorded access granted when it was opened.
An inherited writable file descriptor can remain usable after the file’s mode stops permitting new writable opens.

G

Guest
A guest is an operating system running inside a virtual machine with a view of hardware provided by a hypervisor.
The guest updates its page tables without receiving direct control over every machine frame on the host.
Guest physical address
A guest physical address names memory in the guest OS’s physical view and requires translation to a real machine address.
A guest physical address of zero can map to different machine frames in two VMs running on one host.
gVisor
gVisor interposes a user-space kernel for container system calls, reducing the workload’s direct exposure to the host kernel.
gVisor handles much of a sandbox’s system-call surface before selected operations reach the real host kernel.

H

Hypercall
A hypercall is an explicit request from guest software to the hypervisor to perform an operation on the guest’s behalf.
A hypercall can ask the monitor to change a guest’s virtual machine state without pretending to own the host.
Hypervisor
A hypervisor is the software layer that creates VMs, allocates their resources and retains control of the physical machine.
The hypervisor saves one guest’s CPU state before scheduling another guest onto the same physical core.

I

IOMMU
An IOMMU translates device addresses and enforces mappings that restrict which memory each DMA-capable device may access.
The IOMMU prevents a passed-through network device from writing outside the memory assigned to its VM.

K

Kata Containers
Kata Containers places each container sandbox in a lightweight VM, giving separate sandboxes separate guest kernels.
Kata Containers can put several containers from one pod inside a sandbox that shares one protected guest kernel.
Kernel mode
Kernel mode is the CPU privilege level that allows the operating system to execute protected instructions and manage hardware.
A driver executing in kernel mode can change machine state that an ordinary application cannot directly control.
Kernel page-table isolation
Kernel page-table isolation removes most kernel mappings during user execution to reduce exposure on processors affected by Meltdown.
Kernel page-table isolation switches the active mappings when execution crosses the user–kernel boundary.

L

Limited direct execution
Limited direct execution runs ordinary instructions natively while hardware checks and controlled traps preserve supervisory control.
Limited direct execution gives an application native calculation speed without letting it replace the page tables.
Linux capability
A Linux capability is a separately assignable part of root’s privilege, authorizing a class of privileged operations.
The Linux capability CAP_NET_BIND_SERVICE permits low-port binding without granting all root powers.
Live migration
Live migration transfers a running VM between hosts, usually copying memory before a short final switch in execution.
A passed-through device can complicate live migration because its live hardware state must also be handled.

M

Mandatory access control
Mandatory access control enforces administrator-defined policy independently of an object owner’s discretionary choices.
Mandatory access control can deny a web server a home-directory read that the ordinary file mode permits.
Measured boot
Measured boot records hashes of startup components, often in a TPM, so another party can verify what was loaded.
Measured boot supplies startup measurements for attestation without itself being the signature-based refusal mechanism.
Memory management unit
The memory management unit translates CPU virtual addresses and checks page permissions before permitting memory accesses.
The memory management unit blocks a user-mode write to a page marked supervisor-only in the page table.
Memory overcommitment
Memory overcommitment promises VMs more total memory than the host owns, relying on their active demands not peaking together.
Memory overcommitment can fail to deliver good performance when every guest starts using its full allocation.
memory.high
memory.high is a cgroup memory-pressure threshold that slows allocating tasks and triggers aggressive reclaim above it.
A group can exceed memory.high while reclaim pressure increases, unlike a simple fixed allocation allowance.
memory.max
memory.max is a cgroup hard memory boundary that can trigger a local out-of-memory kill when reclaim cannot satisfy demand.
After cache reclaim and usable swap are exhausted, memory.max can force an eligible task in the group to be killed.
MicroVM
A microVM is a small virtual machine designed with a minimal device model for efficient isolation of lightweight workloads.
A platform can place an untrusted function in a Firecracker microVM to give it a separate guest-kernel boundary.
Mount namespace
A mount namespace separates a process group’s list of mounted file systems, supporting a private visible file tree.
A mount namespace lets a runtime assemble a container root without replacing the host’s own mount list.
Multi-factor authentication
Multi-factor authentication requires proofs from different factor types, such as knowledge plus possession of a device.
A password and an authenticator-app code provide multi-factor authentication, unlike two knowledge questions.

N

Namespace
A namespace gives processes their own instance or view of one category of normally global Linux system state.
A namespace can separate mount lists without placing any CPU limit on the processes that use that view.
Nested paging
Nested paging makes hardware perform guest-virtual-to-guest-physical and guest-physical-to-machine address translation.
Nested paging allows guest page-table edits without requiring software interception of every edit.
Network namespace
A network namespace provides separate interfaces, addresses, routes, ports and other state belonging to a network stack.
Two services in different network namespaces can both listen on port 80 without a namespace-local port conflict.
no_new_privs
no_new_privs is a Linux process flag preventing execution from granting new privilege through setuid or related mechanisms.
With no_new_privs set, a container process cannot gain authority simply by launching a setuid executable.
No-execute bit
A no-execute bit is a page permission that prevents instruction execution from the page while leaving other access separately controlled.
A stack page with the no-execute bit set can hold data but faults if the program tries to execute it.

O

Object capability
An object capability is an unforgeable token naming an object and the operations its holder may perform on that object.
A parent can pass an object capability for one input file without giving its worker access to the whole directory.
Octal mode
An octal mode encodes Unix permission classes using read 4, write 2 and execute 1, with optional special bits.
The octal mode 640 grants owner read and write, group read, and no access through the others class.
Offline attack
An offline attack tests guesses against stolen verifiers on the attacker’s hardware without consulting the login service.
An offline attack continues at its own rate even if the real account is locked after failed logins.

P

Page fault
A page fault is an exception caused by a failed page-translation or permission check, which the kernel must interpret.
A page fault on a copy-on-write mapping can lead to a private page copy and a successful instruction retry.
Page sharing
Page sharing merges identical pages into a read-only copy and restores separate copies when a guest writes to one.
Cross-customer page sharing can reveal matching data through the time needed to create a private writable copy.
PAM
PAM is a Linux authentication framework that lets login services use configured modules for credential checks and related policies.
An SSH login service can use PAM to check credentials before installing the user’s process identity.
Paravirtualization
Paravirtualization modifies a guest interface to request virtual operations explicitly instead of relying entirely on interception.
CPU paravirtualization changes a guest kernel to make hypercalls for operations that require hypervisor control.
Passkey
A passkey is a public-key credential used for site-bound authentication, stored on a device or securely synced between devices.
A synced passkey supports another device’s login while making the platform account part of credential protection.
Password hash
A password hash is a one-way verifier recomputed from a submitted password and stored parameters to check a login.
A stolen password hash can be tested against guesses without revealing a password through decryption.
Password-hashing cost
A password-hashing cost sets the deliberate computation, and sometimes memory, required to calculate one password verifier.
Raising the password-hashing cost slows both a legitimate login check and each attacker guess.
PID namespace
A PID namespace gives processes a separate numbering and visibility hierarchy with its own PID 1 lifecycle.
A process can be PID 1 inside a PID namespace while the host identifies the same process with another number.
pids.max
pids.max is a cgroup task limit that counts both processes and threads and prevents creation beyond the allowed total.
A multithreaded service can reach pids.max even when its number of distinct processes appears small.
POSIX ACL mask
A POSIX ACL mask caps the effective rights of named user entries, named group entries and the owning-group entry.
A POSIX ACL mask of read-only makes a named user’s read-write entry effectively read-only.
Principal
A principal is an entity, such as a person or service account, to which rights are assigned and on whose behalf processes act.
A backup service runs as a separate principal so its file rights can be managed independently of a human user.
Privileged instruction
A privileged instruction performs a protected operation only with sufficient CPU privilege and otherwise causes a trap.
An application’s attempt to execute the privileged instruction HLT on x86 raises a protection fault.
Protection ring
A protection ring is an x86 privilege level; ring 0 is most privileged and ring 3 is least privileged.
Linux normally places application code in protection ring 3 and its kernel code in protection ring 0.
Public-key authenticator
A public-key authenticator proves possession of a private key by signing a challenge that a server verifies with its public key.
A public-key authenticator can complete login without transmitting its private signing key to the server.

R

Reference monitor
A reference monitor is a protected mechanism that mediates access, cannot be bypassed and is small enough to check carefully.
The reference monitor checks a mapping request; hardware then enforces the access already granted in its page table.
Return-oriented programming
Return-oriented programming builds attacker-selected behavior by chaining short instruction sequences already in executable memory.
Return-oriented programming can reuse library instructions without executing injected bytes from a data page.
Role-based access control
Role-based access control assigns permissions to job roles and gives users those permissions through role membership.
Role-based access control lets a job transfer replace role memberships without editing every individual file rule.
Rootless container
A rootless container runs under unprivileged host authority, normally mapping its internal root identity through a user namespace.
A rootless container reduces host privilege but still relies on the host kernel to reject unsafe operations.

S

Salt
A salt is a per-password random value stored with its hash to prevent equal passwords sharing reusable verification work.
Different salts make two accounts with the same password produce different stored password hashes.
Seccomp
Seccomp is a Linux facility that filters a process’s system calls, restricting the kernel services available to it.
A browser renderer’s seccomp policy can block program-launch calls even after the renderer is compromised.
Secure boot
Secure boot verifies trusted signatures along the boot chain and refuses components that fail its configured trust checks.
Secure boot can reject a modified boot loader before that loader receives control of the machine.
SELinux domain
An SELinux domain is a process label used by type-enforcement policy to determine which object types the process may access.
An SELinux domain for a web server can allow page reads while denying reads of user-home file types.
Sensitive instruction
A sensitive instruction changes machine configuration or behaves differently depending on the execution privilege level.
A sensitive instruction that silently changes behavior can defeat classic trap-and-emulate interception.
Setgid directory
A setgid directory makes newly created files inherit its group, helping a team keep shared files under one group identity.
A project’s setgid directory keeps new documents assigned to the project group instead of each author’s primary group.
Setuid
Setuid is an executable-file mechanism that starts a program with its owner’s effective user identity under normal execution rules.
Setuid lets the password helper update a protected verifier file while its code checks which account may change.
Shadow page table
A shadow page table maps guest virtual addresses directly to machine frames and is maintained by the hypervisor in software.
A shadow page table must be updated when the guest changes mappings that the hardware will actually use.
SMAP
SMAP is an x86 protection that restricts supervisor-mode data access to user pages outside explicitly authorized copying.
SMAP requires kernel copying code to deliberately permit the user-memory access needed for a validated buffer.
SMEP
SMEP is an x86 protection that prevents supervisor-mode code from executing instructions in pages marked user-accessible.
SMEP blocks a corrupted kernel return from jumping into attacker-controlled instructions in a user page.
Snapshot
A snapshot preserves VM state for later restoration; a running-state snapshot includes execution and memory as well as disks.
Restoring a full snapshot returns a test VM to its saved CPU, memory and storage state.
Sticky bit
The sticky bit restricts deletion and renaming in a directory to file owners, the directory owner or privileged processes.
The sticky bit stops one ordinary user deleting another user’s entry in a shared mode-1777 temporary directory.
System call
A system call is a controlled request from a user program to the kernel for a service that requires kernel authority.
The open() wrapper makes a system call so the kernel can check access before returning a file descriptor.

T

Timer interrupt
A timer interrupt is a hardware event that returns CPU control to the kernel after a programmed interval.
The timer interrupt lets the scheduler replace a process even when that process never voluntarily yields.
TOCTTOU race
A TOCTTOU race occurs when a checked object or condition changes before use, leaving the earlier decision inapplicable.
A TOCTTOU race lets a replaced symbolic link redirect a privileged helper after its permission check.
TOTP
A TOTP is a short-lived code derived from a shared secret and a time step, commonly used to prove possession of an authenticator.
A fake login page can relay a TOTP to the real service while the code is still valid.
Trap-and-emulate
Trap-and-emulate intercepts a deprivileged guest’s protected operations and applies their effects to virtual machine state.
Trap-and-emulate updates a guest’s virtual interrupt flag without letting it disable host interrupts.
Trusted computing base
The trusted computing base is the hardware, firmware and software whose correct operation the system’s security depends on.
A flaw in a trusted login helper can compromise the trusted computing base even when the kernel is correct.

U

UID mapping
A UID mapping relates a range of user IDs inside a namespace to a range outside it using two starts and a length.
A UID mapping beginning at inside 0 and host 100000 translates inside 1000 to host 101000.
Umask
A umask is a process setting that clears selected permission bits from the mode requested when an object is created.
With a umask of 027, a program’s regular-file request of 666 creates mode 640, not an executable file.
User mode
User mode is the restricted CPU privilege level in which application instructions run subject to hardware protection checks.
A root-owned text editor still executes its ordinary instructions in user mode and requests file operations from the kernel.
User namespace
A user namespace maps user and group IDs between inside and outside views and scopes capabilities to its resources.
A user namespace can map container UID 0 onto an unprivileged host UID instead of host root.

V

Veth pair
A veth pair is a linked pair of virtual network interfaces that can connect a container network namespace with its host.
One end of a veth pair can sit inside a container and the other on a bridge in the host network stack.
Virtio
Virtio is a paravirtual device interface using guest-aware drivers and shared queues to reduce device-handling overhead.
A virtio driver queues several storage requests before notifying the backend, reducing repeated transitions.
Virtual CPU
A virtual CPU is a guest-visible processor whose execution state the hypervisor schedules on a physical processor.
An idle virtual CPU can wait for its virtual interrupt while the physical core runs another guest.
Virtual machine
A virtual machine presents a complete virtual computer to a guest operating system while a hypervisor controls real resources.
A virtual machine can run a Windows kernel on compatible hardware managed by a Linux-based host.
VM entry
A VM entry restores guest execution under hardware virtualization after the hypervisor has selected and prepared its state.
After handling a device notification, the hypervisor performs a VM entry to resume the affected guest.
VM escape
A VM escape breaches the guest boundary through a hypervisor or exposed virtual-device flaw and reaches host authority.
A buggy emulated device can create a VM escape even though the guest’s ordinary page mappings are separate.
VM exit
A VM exit is a hardware-controlled transfer from guest execution to the hypervisor after an event configured for interception.
A VM exit on guest HLT lets the hypervisor stop scheduling the idle vCPU and run another workload.

W

W^X
W^X is a memory policy that forbids a page from being writable and executable at the same time.
Under W^X, a just-in-time compiler writes code first and changes permissions before executing it.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started