Received: from eggs.gnu.org ([2001:4830:134:3::10]:50200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zs9zQ-0005DP-P6 for qemu-devel@nongnu.org; Fri, 30 Oct 2015 09:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zs9zM-0004eH-2U for qemu-devel@nongnu.org; Fri, 30 Oct 2015 09:45:08 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:36170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zs9zL-0004e5-Sr for qemu-devel@nongnu.org; Fri, 30 Oct 2015 09:45:04 -0400 Received: by wicfx6 with SMTP id fx6so10914808wic.1 for ; Fri, 30 Oct 2015 06:45:03 -0700 (PDT) From: Eduardo Otubo Date: Fri, 30 Oct 2015 14:44:49 +0100 Message-Id: <1446212690-7656-5-git-send-email-eduardo.otubo@profitbricks.com> In-Reply-To: <1446212690-7656-1-git-send-email-eduardo.otubo@profitbricks.com> References: <1446212690-7656-1-git-send-email-eduardo.otubo@profitbricks.com> Subject: [Qemu-devel] [PULL 04/05] seccomp: add setuid, setgid, chroot and setgroups to whitelist 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, dann.frazier@canonical.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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index e7a54e8..877fd88 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -238,6 +238,10 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { { SCMP_SYS(inotify_add_watch), 240 }, { SCMP_SYS(mbind), 240 }, { SCMP_SYS(cacheflush), 240 }, + { SCMP_SYS(setuid), 240 }, + { SCMP_SYS(setgid), 240 }, + { SCMP_SYS(chroot), 240 }, + { SCMP_SYS(setgroups), 240 }, }; int seccomp_start(void) -- 2.1.4