Seccomp
Sandbox facility for the Linux kernel / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Seccomp?
Summarize this article for a 10 years old
seccomp (short for secure computing mode) is a computer security facility in the Linux kernel. seccomp allows a process to make a one-way transition into a "secure" state where it cannot make any system calls except exit()
, sigreturn()
, read()
and write()
to already-open file descriptors. Should it attempt any other system calls, the kernel will either just log the event or terminate the process with SIGKILL or SIGSYS.[1][2] In this sense, it does not virtualize the system's resources but isolates the process from them entirely.
Original author(s) | Andrea Arcangeli |
---|---|
Initial release | March 8, 2005; 18 years ago (2005-03-08) |
Written in | C |
Operating system | Linux |
Type | Sandboxing |
License | GNU General Public License |
Website | code |
seccomp mode is enabled via the prctl(2)
system call using the PR_SET_SECCOMP
argument, or (since Linux kernel 3.17[3]) via the seccomp(2)
system call.[4] seccomp mode used to be enabled by writing to a file, /proc/self/seccomp
, but this method was removed in favor of prctl()
.[5] In some kernel versions, seccomp disables the RDTSC
x86 instruction, which returns the number of elapsed processor cycles since power-on, used for high-precision timing.[6]
seccomp-bpf is an extension to seccomp[7] that allows filtering of system calls using a configurable policy implemented using Berkeley Packet Filter rules. It is used by OpenSSH[8] and vsftpd as well as the Google Chrome/Chromium web browsers on ChromeOS and Linux.[9] (In this regard seccomp-bpf achieves similar functionality, but with more flexibility and higher performance, to the older systrace—which seems to be no longer supported for Linux.)
Some consider seccomp comparable to OpenBSD pledge(2) and FreeBSD capsicum(4)[citation needed].