From 5451b8db9db7dabb46e9f1966d72406c9da271a9 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Fri, 13 Feb 2015 16:05:49 +0000 Subject: Use pivot_root in addition to chroot when possible chroot only changes the process root directory, not the mount namespace root directory, and it is well-known that any process with chroot capability can break out of a chroot "jail". By using pivot_root as well, and unmounting the original mount namespace root directory, breaking out becomes impossible. Non-root processes typically have no ability to use chroot() anyway, but they can gain that capability through the use of clone() or unshare(). For security reasons, these syscalls are limited in functionality when used inside a normal chroot environment. Using pivot_root() this way does allow those syscalls to be put to their full use. --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index be77975bd3ab..756b2f22729c 100644 --- a/configure.ac +++ b/configure.ac @@ -87,6 +87,7 @@ AC_CHECK_HEADERS([sys/mount.h], [], [], # include # endif ]) +AC_CHECK_HEADERS([sys/syscall.h]) # Check for lutimes, optionally used for changing the mtime of -- cgit 1.4.1