qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH] Add syscalls for -runas and -chroot to the seccomp sandbox
@ 2015-10-09  2:09 namnamc
  2015-10-09  6:54 ` Markus Armbruster
  0 siblings, 1 reply; 12+ messages in thread
From: namnamc @ 2015-10-09  2:09 UTC (permalink / raw)
  To: eduardo.otubo; +Cc: qemu-devel

> ps.: the threads are still being broken by your emails and it's a pain
> to track down all of them in order to read. Please fix it.

I'm really sorry, I am not able to sign up to Google because I don't have a
cell number. I'll try using Sigaint. Does it work now?

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] Add syscalls for -runas and -chroot to the seccomp sandbox
@ 2015-10-02  0:17 namnamc
  0 siblings, 0 replies; 12+ messages in thread
From: namnamc @ 2015-10-02  0:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru, eduardo.otubo

> Should it enable seccomp a bit later?

Ideally it should be enabled as late as possible, right before the main loop,
because here's no reason to whitelist syscalls that are only ever needed to
start QEMU up (e.g. chroot, which is only used before the guest even boots).
But for now, the simplest solution to the -chroot and -runas issue I can
think
of is to enable those syscalls in my patch.

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [Qemu-devel] [PATCH] Add syscalls for -runas and -chroot to the seccomp sandbox
@ 2015-10-01  4:36 Namsun Ch'o
  2015-10-01 12:06 ` Markus Armbruster
  2015-10-08 13:34 ` Eduardo Otubo
  0 siblings, 2 replies; 12+ messages in thread
From: Namsun Ch'o @ 2015-10-01  4:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: eduardo.otubo

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 <namnamc@safe-mail.net>
---
diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index f9de0d3..5cb1809 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -237,7 +237,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(fadvise64), 240 },
     { SCMP_SYS(inotify_init1), 240 },
     { SCMP_SYS(inotify_add_watch), 240 },
-    { SCMP_SYS(mbind), 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)

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-10-09  7:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09  2:09 [Qemu-devel] [PATCH] Add syscalls for -runas and -chroot to the seccomp sandbox namnamc
2015-10-09  6:54 ` Markus Armbruster
2015-10-09  7:24   ` Eduardo Otubo
  -- strict thread matches above, loose matches on Subject: below --
2015-10-02  0:17 namnamc
2015-10-01  4:36 Namsun Ch'o
2015-10-01 12:06 ` Markus Armbruster
2015-10-02  8:30   ` Daniel P. Berrange
2015-10-02 10:05     ` Markus Armbruster
2015-10-02 14:08       ` Eduardo Otubo
2015-10-02 14:15         ` Daniel P. Berrange
2015-10-02 15:36           ` Eduardo Otubo
2015-10-08 13:34 ` Eduardo Otubo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).