From: "Daniel P. Berrange" <berrange@redhat.com>
To: Eduardo Otubo <otubo@redhat.com>
Cc: qemu-devel@nongnu.org, thuth@redhat.com
Subject: Re: [Qemu-devel] [PATCHv4 1/6] seccomp: changing from whitelist to blacklist
Date: Fri, 1 Sep 2017 12:04:22 +0100 [thread overview]
Message-ID: <20170901110422.GJ31680@redhat.com> (raw)
In-Reply-To: <20170901105818.31956-2-otubo@redhat.com>
On Fri, Sep 01, 2017 at 12:58:13PM +0200, Eduardo Otubo wrote:
> This patch changes the default behavior of the seccomp filter from
> whitelist to blacklist. By default now all system calls are allowed and
> a small black list of definitely forbidden ones was created.
>
> Signed-off-by: Eduardo Otubo <otubo@redhat.com>
> ---
> include/sysemu/seccomp.h | 2 +
> qemu-seccomp.c | 264 ++++++-----------------------------------------
> vl.c | 1 -
> 3 files changed, 35 insertions(+), 232 deletions(-)
>
> diff --git a/include/sysemu/seccomp.h b/include/sysemu/seccomp.h
> index cfc06008cb..23b9c3c789 100644
> --- a/include/sysemu/seccomp.h
> +++ b/include/sysemu/seccomp.h
> + for (i = 0; i < ARRAY_SIZE(blacklist); i++) {
> + switch (blacklist[i].set) {
> + default:
> + goto add_syscall;
This goto rule is pointless - just use 'break'
> }
> - rc = seccomp_syscall_priority(ctx, seccomp_whitelist[i].num,
> - seccomp_whitelist[i].priority);
> +add_syscall:
> + rc = seccomp_rule_add(ctx, SCMP_ACT_KILL, blacklist[i].num, 0);
> if (rc < 0) {
> goto seccomp_return;
> }
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2017-09-01 11:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 10:58 [Qemu-devel] [PATCHv4 0/6] seccomp: feature refactoring Eduardo Otubo
2017-09-01 10:58 ` [Qemu-devel] [PATCHv4 1/6] seccomp: changing from whitelist to blacklist Eduardo Otubo
2017-09-01 11:04 ` Daniel P. Berrange [this message]
2017-09-01 10:58 ` [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to command line Eduardo Otubo
2017-09-01 11:05 ` Daniel P. Berrange
2017-09-07 9:31 ` Eduardo Otubo
2017-09-07 9:59 ` Daniel P. Berrange
2017-09-07 9:57 ` Daniel P. Berrange
2017-09-01 10:58 ` [Qemu-devel] [PATCHv4 3/6] seccomp: add elevateprivileges " Eduardo Otubo
2017-09-07 9:58 ` Daniel P. Berrange
2017-09-01 10:58 ` [Qemu-devel] [PATCHv4 4/6] seccomp: add spawn " Eduardo Otubo
2017-09-01 10:58 ` [Qemu-devel] [PATCHv4 5/6] seccomp: add resourcecontrol " Eduardo Otubo
2017-09-01 10:58 ` [Qemu-devel] [PATCHv4 6/6] seccomp: adding documentation to new seccomp model Eduardo Otubo
2017-09-01 11:03 ` Daniel P. Berrange
2017-09-01 11:32 ` [Qemu-devel] [PATCHv4 0/6] seccomp: feature refactoring no-reply
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=20170901110422.GJ31680@redhat.com \
--to=berrange@redhat.com \
--cc=otubo@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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).