Skip to content

Interview question · Systems, OS & Memory Safety

What is a process from a security point of view, and what stops one process from reading another's memory?

Isolation is enforced by page tables and credentials, then deliberately punched through by debuggers, shared memory and IPC. A strong answer names both the wall and the doors.

easyEssentialNewPreparation tags: Google, Microsoft, AppleUpdated Nov 2026

TL;DR: A process is a running program plus the things the kernel attaches to it: a private virtual address space, credentials (user, groups, capabilities), open handles and limits. One process cannot read another's memory because each has its own page tables, which only the kernel can change, so the other process's physical pages are simply not addressable. Isolation is then deliberately relaxed through debugging interfaces (ptrace, Windows debug privileges), shared memory, IPC and inherited handles, and each of those doors has its own access check. Threads inside one process share the address space, so there is no isolation between them at all.

How to approach it

Define the process by what the kernel tracks, explain the mechanism that isolates memory, then list the legitimate ways across and the check guarding each. Close with the security consequence: a process boundary is only as strong as the most permissive of those doors, and it is not a boundary between threads.

A strong answer

FIG · A PROCESS · WHAT THE KERNEL ATTACHES
Isolation by default, with deliberate doors
  1. Address space

    Own page tables

    • Other processes' memory is not addressable
    • Only the kernel edits page tables
  2. Credentials

    UID, GIDs, capabilities

    • Checked on every privileged request
  3. Handles

    Files, sockets, pipes

    • Inherited by children unless marked close-on-exec
  4. Door: debugging

    ptrace, debug privileges

    • Same-user debugging allowed by default on many systems
    • Yama ptrace_scope restricts it
  5. Door: shared memory and IPC

    Mapped regions, sockets

    • Each with its own access check
  6. Threads

    Share everything

    • No isolation between threads of one process

What the kernel keeps per process.

  • An address space: page tables mapping virtual addresses to physical memory, with per-page permissions (read, write, execute, user or supervisor).
  • Credentials: on Linux the real, effective and saved user and group IDs plus capability sets; on Windows an access token with SIDs, groups, privileges and an integrity level.
  • Handles: file descriptors or Windows handles to files, sockets, pipes and other objects, each opened with specific rights.
  • Limits and accounting: resource limits, cgroup membership, the namespace set it lives in.

Why one process cannot read another's memory. A process only ever issues virtual addresses. The memory management unit translates them using the current process's page tables, which the kernel switches on every context switch. If another process's pages are not in your tables, no address you can form reaches them; trying to touch an unmapped address faults. Only the kernel can edit page tables, so the guarantee holds as long as the kernel is correct.

The doors, and their locks.

MechanismWhat it allowsThe access check
ptrace (Linux), ReadProcessMemory/debug privilege (Windows)Read and write another process's memory and registersSame user and not more privileged, or a capability (CAP_SYS_PTRACE); Yama ptrace_scope can restrict further; SeDebugPrivilege on Windows bypasses most checks
/proc/<pid>/mem and friendsMemory access through the filesystemThe same ptrace access rules
Shared memory, memory-mapped filesPages deliberately mapped into bothPermissions on the shared object or file
Pipes, sockets, message queues, COM/RPCData exchangePermissions on the endpoint; the receiver must treat data as untrusted
Inherited handles across fork/exec or CreateProcessA child gets the parent's open descriptorsThe parent's choice; forgetting O_CLOEXEC leaks descriptors to children

This is why "same user" means "no real isolation" on a classic desktop: two processes under one account can usually debug each other. Browsers and mobile platforms add sandboxing (separate users, seccomp or Seatbelt policies, restricted tokens) precisely because the default process boundary between same-user processes is weak.

Threads. Threads in one process share the address space and handles. A bug in one thread can corrupt data used by another, and a plugin loaded into a process has the process's full access. If you need isolation, you need a separate process with different credentials, not a thread.

Where this shows up in an interview about AI systems. A model-serving process that loads a third-party model with a code-executing loader runs that code with the server's credentials and address space. Moving the loader into a separate, less privileged process with no network and no secrets is the process-isolation answer to an AI supply-chain problem.

What interviewers probe next

  • "What is inherited across fork and exec?" The child starts with the parent's credentials, environment, open descriptors (unless marked close-on-exec), working directory and resource limits. exec replaces the memory image but keeps descriptors, which is how secrets leak into helper programs.
  • "How would you stop a compromised process from debugging others of the same user?" Raise ptrace_scope, run sensitive work under its own user, and use a sandbox profile that denies process inspection.
  • "Is a process boundary enough for untrusted code?" Only if the process also runs with minimal credentials and a reduced system call surface. The shared kernel remains the weak point.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

You run two services on one Linux host: a public API and a billing worker that holds payment credentials.

  1. Start here

    What is a process, security-wise?

How it's scored

Weak: "Each process has its own memory." No mechanism, no exceptions.

Hire: Explains virtual memory and page tables, credentials and handles, and names ptrace and shared memory as deliberate ways across.

Strong Hire: Lists the doors with their access checks, explains why same-user processes are weakly isolated, distinguishes threads, and applies process separation to a real design such as isolating a model loader.

Common mistakes

  • Saying processes are isolated "by the hardware" without the kernel's page tables in the story.
  • Forgetting that debugging interfaces exist and are governed by user and capability checks.
  • Treating threads as isolated from each other.
  • Ignoring descriptors inherited by child processes.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.