What is a system call?

A system call is the interface between a program and the kernel. A program uses it to ask the kernel for work, such as reading a file or opening a network connection.

Updated

How a program makes a system call

A program usually does not call the kernel directly. It calls a wrapper function in the C library, such as glibc. The wrapper copies the arguments and the call number into registers, then enters kernel mode. The kernel, the core of the operating system, does the work and returns the result. On error, the wrapper returns -1 and sets errno, a variable that holds the error number.

Why the interface matters for sandboxes

In a plain container, each system call runs on the host kernel. A flaw in the kernel code for one call can give a program more access than it should have. So the system call interface is the attack surface of a shared kernel. Code you do not trust can reach that surface.

How sandboxes limit system calls

gVisor handles system calls itself. The Sentry is the kernel part of gVisor. It is written in Go and runs in user space. It does not pass system calls through to the host kernel. Seccomp is a separate Linux feature. It filters which system calls a process may make.

What to check on a provider's page

  • Check whether the sandbox runs its own kernel, such as in a microVM.
  • Check whether the provider names a user-space kernel or a system call filter.
Referenceman7.org

Related terms

All glossary terms

Related