Received: from eggs.gnu.org ([2001:4830:134:3::10]:35851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdQb-0001AJ-Hz for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:58:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmdQX-0004xy-6G for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:58:21 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdQX-0004xs-0Z for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:58:17 -0400 Received: by wicgb1 with SMTP id gb1so260653229wic.1 for ; Thu, 15 Oct 2015 00:58:16 -0700 (PDT) From: Eduardo Otubo Date: Thu, 15 Oct 2015 09:58:00 +0200 Message-Id: <1444895880-27681-5-git-send-email-eduardo.otubo@profitbricks.com> In-Reply-To: <1444895880-27681-1-git-send-email-eduardo.otubo@profitbricks.com> References: <1444895880-27681-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 | 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