Received: from eggs.gnu.org ([2001:4830:134:3::10]:50833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmIWY-0005dM-PO for qemu-devel@nongnu.org; Wed, 14 Oct 2015 05:39:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmIWT-0007Z8-Pg for qemu-devel@nongnu.org; Wed, 14 Oct 2015 05:39:06 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:37589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmIWT-0007Z4-Iu for qemu-devel@nongnu.org; Wed, 14 Oct 2015 05:39:01 -0400 Received: by wijq8 with SMTP id q8so72469004wij.0 for ; Wed, 14 Oct 2015 02:39:01 -0700 (PDT) From: Eduardo Otubo Date: Wed, 14 Oct 2015 11:38:26 +0200 Message-Id: <1444815506-30087-5-git-send-email-eduardo.otubo@profitbricks.com> In-Reply-To: <1444815506-30087-1-git-send-email-eduardo.otubo@profitbricks.com> References: <1444815506-30087-1-git-send-email-eduardo.otubo@profitbricks.com> Subject: [Qemu-devel] [PULL 04/04] Add syscalls for -runas and -chroot to the seccomp sandbox List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Namsun Ch'o , peter.maydell@linaro.org, drjones@redhat.com From: Namsun Ch'o The seccomp sandbox doesn't whitelist setuid, setgid, or setgroups, which are needed for -runas to work. It also doesn't whitelist chroot, which is needed for the -chroot option. Unfortunately, QEMU enables seccomp before it drops privileges or chroots, so without these whitelisted, -runas and -chroot cause QEMU to be killed with -sandbox on. This patch adds those syscalls. Signed-off-by: Namsun Ch'o Acked-by: Eduardo Otubo --- qemu-seccomp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index a54d358..429b208 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -237,7 +237,12 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { { SCMP_SYS(inotify_init1), 240 }, { SCMP_SYS(inotify_add_watch), 240 }, { SCMP_SYS(mbind), 240 }, - { SCMP_SYS(cacheflush), 240 } + { SCMP_SYS(cacheflush), 240 }, + { SCMP_SYS(mbind), 240 }, + { SCMP_SYS(setuid), 240 }, + { SCMP_SYS(setgid), 240 }, + { SCMP_SYS(chroot), 240 }, + { SCMP_SYS(setgroups), 240 } }; int seccomp_start(void) -- 2.1.4