qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Namsun Ch'o <namnamc@airmail.cc>
To: eduardo.otubo@profitbricks.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PULL 04/05] seccomp: add setuid, setgid, chroot and setgroups to whitelist
Date: Wed, 18 Nov 2015 07:10:05 +0000	[thread overview]
Message-ID: <c2b16793c88670d3ac3f4451cd6470ea@airmail.cc> (raw)

> I think this patch should not be applied, because it completely defeats
> the purpose of the sandbox.  With these syscalls whitelisted, -runas 
> and
> -chroot have absolutely no effect against an attacker, even with
> -sandbox on.
> 
> Paolo

Adding chroot() and set*id() doesn't break the purpose of the sandbox 
though,
because the only purpose of seccomp is to reduce kernel attack surface 
area.
Just because setuid() is permitted does not mean it can get root (and 
even if
it did, it would not escape the sandbox and be permitted to use denied
syscalls). The sandbox will be enforced no matter what your EUID.

The whitelist only means those calls are permitted, not that they will 
always
succeed without permission checks. If allowing them defeats the purpose 
of
-runas and -chroot, then both of those options would be useless without 
a
sandbox anyway. The only time I can think of where it wouldn't stop an
attacker is if you do -runas root with -chroot (which is silly because 
not
only does -runas root not work even if you are root, and root can break 
out of
a chroot anyway). Furthermore, if an attacker manages to find a kernel 
exploit
which gives them root anyway, they would do so without calling setuid() 
at
all. Which again shows that the purpose of the seccomp sandbox is to 
prevent
the kernel from being compromised, not to prevent a non-root process 
from
breaking out of a chroot or using setuid(0). That's what standard 
permission
checks are for, which a syscall whitelist does not replace or disable.

> Also, Namsun's emails are bouncing back. Don't know if it's worth to
> merge them with no valid author's contact.

My old email service had a hardware failure. I don't know when it'll be 
up.

             reply	other threads:[~2015-11-18  7:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18  7:10 Namsun Ch'o [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-11-19  2:35 [Qemu-devel] [PULL 04/05] seccomp: add setuid, setgid, chroot and setgroups to whitelist Namsun Ch'o
2015-10-30 13:44 [Qemu-devel] [PULL 00/05] seccomp branch queue Eduardo Otubo
2015-10-30 13:44 ` [Qemu-devel] [PULL 04/05] seccomp: add setuid, setgid, chroot and setgroups to whitelist Eduardo Otubo
2015-11-02  7:51   ` Paolo Bonzini
2015-11-11  8:25     ` Eduardo Otubo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2b16793c88670d3ac3f4451cd6470ea@airmail.cc \
    --to=namnamc@airmail.cc \
    --cc=eduardo.otubo@profitbricks.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).