Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
seccomp
Sandbox facility for the Linux kernel

seccomp (short for secure computing) 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. In this sense, it does not virtualize the system's resources but isolates the process from them entirely.

seccomp mode is enabled via the prctl(2) system call using the PR_SET_SECCOMP argument, or (since Linux kernel 3.17) via the seccomp(2) system call. seccomp mode used to be enabled by writing to a file, /proc/self/seccomp, but this method was removed in favor of prctl(). 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.

seccomp-bpf is an extension to seccomp that allows filtering of system calls using a configurable policy implemented using Berkeley Packet Filter rules. It is used by OpenSSH and vsftpd as well as the Google Chrome/Chromium web browsers on ChromeOS and Linux. (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).

We don't have any images related to seccomp yet.
We don't have any YouTube videos related to seccomp yet.
We don't have any PDF documents related to seccomp yet.
We don't have any Books related to seccomp yet.
We don't have any archived web articles related to seccomp yet.

History

seccomp was first devised by Andrea Arcangeli in January 2005 for use in public grid computing and was originally intended as a means of safely running untrusted compute-bound programs. It was merged into the Linux kernel mainline in kernel version 2.6.12, which was released on March 8, 2005.11

Software using seccomp or seccomp-bpf

  • Android uses a seccomp-bpf filter in the zygote since Android 8.0 Oreo.12
  • systemd's sandboxing options are based on seccomp.13
  • QEMU, the Quick Emulator, the core component to the modern virtualization together with KVM uses seccomp on the parameter --sandbox14
  • Docker – software that allows applications to run inside of isolated containers. Docker can associate a seccomp profile with the container using the --security-opt parameter.
  • Arcangeli's CPUShare was the only known user of seccomp for a while.15 Writing in February 2009, Linus Torvalds expresses doubt whether seccomp is actually used by anyone.16 However, a Google engineer replied that Google is exploring using seccomp for sandboxing its Chrome web browser.1718
  • Firejail is an open source Linux sandbox program that utilizes Linux namespaces, Seccomp, and other kernel-level security features to sandbox Linux and Wine applications.19
  • As of Chrome version 20, seccomp-bpf is used to sandbox Adobe Flash Player.20
  • As of Chrome version 23, seccomp-bpf is used to sandbox the renderers.21
  • Snap specify the shape of their application sandbox using "interfaces" which snapd translates to seccomp, AppArmor and other security constructs22
  • vsftpd uses seccomp-bpf sandboxing as of version 3.0.0.23
  • OpenSSH has supported seccomp-bpf since version 6.0.24
  • Mbox uses ptrace along with seccomp-bpf to create a secure sandbox with less overhead than ptrace alone.25
  • LXD, a Ubuntu "hypervisor" for containers2627
  • Firefox and Firefox OS, which use seccomp-bpf2829
  • Tor supports seccomp since 0.2.5.1-alpha30
  • Lepton, a JPEG compression tool developed by Dropbox uses seccomp31
  • Kafel is a configuration language, which converts readable policies into seccompb-bpf bytecode32
  • Subgraph OS uses seccomp-bpf3334
  • Flatpak uses seccomp for process isolation35
  • Bubblewrap is a lightweight sandbox application developed from Flatpak36
  • minijail37 uses seccomp for process isolation38
  • SydBox uses seccomp-bpf39 to improve the runtime and security of the ptrace sandboxing used to sandbox package builds on Exherbo Linux distribution.
  • File, a Unix program to determine filetypes, uses seccomp to restrict its runtime environment40
  • Zathura, a minimalistic document viewer, uses seccomp filter to implement different sandbox modes41
  • Tracker, a indexing and preview application for the GNOME desktop environment, uses seccomp to prevent automatic exploitation of parsing vulnerabilities in media files42

References

  1. seccomp(2): "The seccomp() system call operates on the Secure Computing (seccomp) state" – Linux Programmer's Manual – System Calls https://manned.org/seccomp.2

  2. Corbet, Jonathan (2015-09-02). "A seccomp overview". lwn. Retrieved 2017-10-05. https://lwn.net/Articles/656307/

  3. "Documentation/prctl/seccomp_filter.txt". Retrieved 2017-10-05. https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt

  4. "Linux kernel 3.17, Section 11. Security". kernelnewbies.org. 2013-10-05. Retrieved 2015-03-31. http://kernelnewbies.org/Linux_3.17#head-6fd84937bbba3b384979760008858881c99e4a53

  5. "seccomp: add "seccomp" syscall". kernel/git/torvalds/linux.git - Linux kernel source tree. kernel.org. 2014-06-25. Retrieved 2014-08-22. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=48dc92b9fc3926844257316e75ba11eb5c742b2c

  6. Arcangeli, Andrea (2007-06-14). "[PATCH 1 of 2] move seccomp from /proc to a prctl". Retrieved 2013-08-02. http://lkml.indiana.edu/hypermail/linux/kernel/0706.1/2525.html

  7. Tinnes, Julien (2009-05-28). "Time-stamp counter disabling oddities in the Linux kernel". cr0 blog. Retrieved 2013-08-02. http://blog.cr0.org/2009/05/time-stamp-counter-disabling-oddities.html

  8. Corbet, Jonathan (2012-01-11). "Yet another new approach to seccomp". lwn. Retrieved 2013-08-02. https://lwn.net/Articles/475043/

  9. "Openssh 6.0 release notes". Retrieved 2013-10-14. https://www.openssh.com/txt/release-6.0

  10. Tinnes, Julien (2012-11-19). "A safer playground for your Linux and Chrome OS renderers". The Chromium Blog. Retrieved 2013-08-02. https://blog.chromium.org/2012/11/a-safer-playground-for-your-linux-and.html

  11. "[PATCH] seccomp: secure computing support". Linux kernel history. Kernel.org git repositories. 2005-03-08. Archived from the original on 2013-04-15. Retrieved 2013-08-02. https://archive.today/20130415050745/http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commit;h=d949d0ec9c601f2b148bed3cdb5f87c052968554

  12. "Seccomp filter in Android O". Android Developers Blog. https://android-developers.googleblog.com/2017/07/seccomp-filter-in-android-o.html

  13. "systemd.exec — Execution environment configuration". freedesktop.org. Retrieved 2017-10-14. https://www.freedesktop.org/software/systemd/man/systemd.exec.html

  14. Otubo, Eduardo (2017-09-15). "QEMU Sandboxing new model pull request". qemu-devel mailing list archive. https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04072.html

  15. van de Ven, Arjan (2009-02-28). "Re: [stable] [PATCH 2/2] x86-64: seccomp: fix 32/64 syscall hole". Linux Kernel Mailing List. Retrieved 2013-08-02. https://lkml.org/lkml/2009/2/28/141

  16. Torvalds, Linus (2009-02-28). "Re: [PATCH 2/2] x86-64: seccomp: fix 32/64 syscall hole". Linux Kernel Mailing List. Retrieved 2013-08-02. https://lkml.org/lkml/2009/2/28/129

  17. Gutschke, Markus (2009-05-06). "Re: [PATCH 2/2] x86-64: seccomp: fix 32/64 syscall hole". Retrieved 2013-08-02. http://article.gmane.org/gmane.linux.ports.sparc/11622

  18. Gutschke, Markus (2009-05-06). "Re: [PATCH 2/2] x86-64: seccomp: fix 32/64 syscall hole". Linux Kernel Mailing List. Retrieved 2013-08-02. https://lkml.org/lkml/2009/5/6/365

  19. "Firejail". Firejail. Retrieved 2016-11-26. https://firejail.wordpress.com/

  20. Evans, Chris (2012-07-04). "Chrome 20 on Linux and Flash sandboxing". Retrieved 2013-08-02. http://scarybeastsecurity.blogspot.com/2012/07/chrome-20-on-linux-and-flash-sandboxing.html

  21. Tinnes, Julien (2012-09-06). "Introducing Chrome's next-generation Linux sandbox". cr0 blog. Retrieved 2013-08-02. http://blog.cr0.org/2012/09/introducing-chromes-next-generation.html

  22. "Snap security policy". Archived from the original on 2017-02-04. Retrieved 2017-02-03. https://web.archive.org/web/20170204012221/https://developer.ubuntu.com/en/snappy/guides/security/

  23. Evans, Chris (2012-04-09). "vsftpd-3.0.0 and seccomp filter sandboxing is here!". Retrieved 2013-08-02. http://scarybeastsecurity.blogspot.de/2012/04/vsftpd-300-and-seccomp-filter.html

  24. "Openssh 6.0 release notes". Retrieved 2013-10-14. https://www.openssh.com/txt/release-6.0

  25. "MBOX". Retrieved 2014-05-20. http://pdos.csail.mit.edu/mbox/

  26. "LXD an "hypervisor" for containers (based on liblxc)". 4 November 2014. Retrieved 2014-11-08. https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-November/010817.html

  27. "Where We're Going With LXD". Retrieved 2014-11-08. http://blog.dustinkirkland.com/2014/11/where-were-going-with-lxd.html

  28. Destuynder, Guillaume (2012-09-13). "Firefox Seccomp sandbox". Mozilla Bugzilla. Retrieved 2015-01-13. https://bugzilla.mozilla.org/show_bug.cgi?id=790923

  29. Destuynder, Guillaume (2012-09-13). "Firefox Seccomp sandbox". Mozilla Wiki. Retrieved 2015-01-13. https://wiki.mozilla.org/Security/Sandbox/Seccomp

  30. "Tor ChangeLog". https://gitweb.torproject.org/tor.git/plain/ChangeLog

  31. "Lepton image compression: saving 22% losslessly from images at 15MB/s". Dropbox Tech Blog. Retrieved 2016-07-15. https://blogs.dropbox.com/tech/2016/07/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs/

  32. "Kafel: A language and library for specifying syscall filtering policies". https://google.github.io/kafel/

  33. "Subgraph OS". Subgraph. Retrieved 2016-12-18. https://subgraph.com/

  34. "LoganCIJ16: Future of OS". YouTube. Archived from the original on 2021-12-21. Retrieved 2016-12-18. https://www.youtube.com/watch?v=Nol8kKoB-co&t=48m56s

  35. "The flatpak security model – part 1: The basics". Retrieved 2017-01-21. https://blogs.gnome.org/alexl/2017/01/18/the-flatpak-security-model-part-1-the-basics/

  36. "bubblewrap". Retrieved 2018-04-14. https://wiki.archlinux.org/index.php/Bubblewrap

  37. "Chromium OS Sandboxing - the Chromium Projects". https://www.chromium.org/chromium-os/developer-guide/chromium-os-sandboxing

  38. "Minijail [LWN.net]". lwn.net. Retrieved 2017-04-11. https://lwn.net/Articles/700557/

  39. "core/trace/use_seccomp". dev.exherbo.org. Retrieved 2021-05-31. https://dev.exherbo.org/~alip/sydbox/sydbox.html

  40. "File application Sandboxing". GitHub. https://github.com/file/file/blob/master/src/seccomp.c

  41. "Zathura seccomp implementation". https://github.com/pwmt/zathura/blob/develop/zathura/seccomp-filters.c

  42. "Gnome tracker seccomp implementation". https://gitlab.gnome.org/GNOME/tracker-miners/-/blob/master/src/libtracker-miners-common/tracker-seccomp.c