qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/3] seccomp fixes
@ 2018-08-22 14:29 Marc-André Lureau
  2018-08-22 14:29 ` [Qemu-devel] [PATCH v3 1/3] seccomp: use SIGSYS signal instead of killing the thread Marc-André Lureau
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Marc-André Lureau @ 2018-08-22 14:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: pmoore, Eduardo Otubo, Marc-André Lureau

Hi,

This series fixes 2 issues with -sandbox:

- The seccomp action SCMP_ACT_KILL results in immediate termination of
  the thread that made the bad system call. However, qemu being
  multi-threaded, it keeps running. There is no easy way for parent
  process / management layer (libvirt) to know about that situation.

  Instead, the default SIGSYS handler when invoked with SCMP_ACT_TRAP
  will terminate the program and core dump.

  This may not be the most secure solution, but probably better than
  just killing the offending thread. SCMP_ACT_KILL_PROCESS has been
  added in Linux 4.14 to improve the situation, which I propose to use
  by default if available.

  Related to:
  https://bugzilla.redhat.com/show_bug.cgi?id=1594456

- The seccomp filter isn't applied to all threads. We can solve the
  issue by using SECCOMP_FILTER_FLAG_TSYNC since libseccomp 2.2.0 and
  kernel >= 3.17. The issue remains on older kernels or older
  libseccomp. I chose to report an error by default, but we may want
  it to fail instead.

v3:
- modify qemu_seccomp() to set errno=ENOSYS
- add patch "seccomp: set the seccomp filter to all threads"

v2:
- fix clang unused inline warning
- add acked-by/r-b tags

Marc-André Lureau (3):
  seccomp: use SIGSYS signal instead of killing the thread
  seccomp: prefer SCMP_ACT_KILL_PROCESS if available
  seccomp: set the seccomp filter to all threads

 qemu-seccomp.c  | 96 +++++++++++++++++++++++++++++++++++++++++++++++--
 qemu-options.hx |  2 ++
 2 files changed, 95 insertions(+), 3 deletions(-)

-- 
2.18.0.547.g1d89318c48

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

end of thread, other threads:[~2018-08-22 16:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-22 14:29 [Qemu-devel] [PATCH v3 0/3] seccomp fixes Marc-André Lureau
2018-08-22 14:29 ` [Qemu-devel] [PATCH v3 1/3] seccomp: use SIGSYS signal instead of killing the thread Marc-André Lureau
2018-08-22 14:29 ` [Qemu-devel] [PATCH v3 2/3] seccomp: prefer SCMP_ACT_KILL_PROCESS if available Marc-André Lureau
2018-08-22 14:29 ` [Qemu-devel] [PATCH v3 3/3] seccomp: set the seccomp filter to all threads Marc-André Lureau
2018-08-22 15:46   ` Daniel P. Berrangé
2018-08-22 15:58     ` Marc-André Lureau
2018-08-22 16:06       ` Daniel P. Berrangé
2018-08-22 16:37         ` Marc-André Lureau
2018-08-22 16:39           ` Marc-André Lureau
2018-08-22 16:46             ` Daniel P. Berrangé
2018-08-22 16:51           ` Daniel P. Berrangé
2018-08-22 16:07       ` Eric Blake
2018-08-22 16:19         ` Marc-André Lureau
2018-08-22 16:43           ` Daniel P. Berrangé
2018-08-22 16:53             ` Daniel P. Berrangé
2018-08-22 15:30 ` [Qemu-devel] [PATCH v3 0/3] seccomp fixes 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).