All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, pmoore@redhat.com, eblake@redhat.com,
	Eduardo Otubo <otubo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 4/4] seccomp: set the seccomp filter to all threads
Date: Wed, 22 Aug 2018 18:23:37 +0100	[thread overview]
Message-ID: <20180822172337.GY12750@redhat.com> (raw)
In-Reply-To: <20180822170250.29573-5-marcandre.lureau@redhat.com>

On Wed, Aug 22, 2018 at 07:02:50PM +0200, Marc-André Lureau wrote:
> When using "-seccomp on", the seccomp policy is only applied to the
> main thread, the vcpu worker thread and other worker threads created
> after seccomp policy is applied; the seccomp policy is not applied to
> e.g. the RCU thread because it is created before the seccomp policy is
> applied and SECCOMP_FILTER_FLAG_TSYNC isn't used.
> 
> This can be verified with
> for task in /proc/`pidof qemu`/task/*; do cat $task/status | grep Secc ; done
> Seccomp:	2
> Seccomp:	0
> Seccomp:	0
> Seccomp:	2
> Seccomp:	2
> Seccomp:	2
> 
> Starting with libseccomp 2.2.0 and kernel >= 3.17, we can use
> seccomp_attr_set(ctx, > SCMP_FLTATR_CTL_TSYNC, 1) to update the policy
> on all threads.
> 
> libseccomp requirement was bumped to 2.2.0 in previous patch.
> libseccomp should fail to set the filter if it can't honour
> SCMP_FLTATR_CTL_TSYNC (untested), and thus -sandbox will now fail on
> kernel < 3.17.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  qemu-seccomp.c | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

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 :|

  reply	other threads:[~2018-08-22 17:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 17:02 [Qemu-devel] [PATCH v4 0/4] seccomp fixes Marc-André Lureau
2018-08-22 17:02 ` [Qemu-devel] [PATCH v4 1/4] seccomp: use SIGSYS signal instead of killing the thread Marc-André Lureau
2018-08-22 17:02 ` [Qemu-devel] [PATCH v4 2/4] seccomp: prefer SCMP_ACT_KILL_PROCESS if available Marc-André Lureau
2018-08-22 17:02 ` [Qemu-devel] [PATCH v4 3/4] configure: require libseccomp 2.2.0 Marc-André Lureau
2018-08-22 17:19   ` Daniel P. Berrangé
2018-08-22 17:02 ` [Qemu-devel] [PATCH v4 4/4] seccomp: set the seccomp filter to all threads Marc-André Lureau
2018-08-22 17:23   ` Daniel P. Berrangé [this message]
2018-08-23 14:43 ` [Qemu-devel] [PATCH v4 0/4] seccomp fixes 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=20180822172337.GY12750@redhat.com \
    --to=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=otubo@redhat.com \
    --cc=pmoore@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.