Received: from eggs.gnu.org ([2001:4830:134:3::10]:57361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoYlu-0001rQ-60 for qemu-devel@nongnu.org; Thu, 05 Dec 2013 08:15:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoYll-0002l9-NI for qemu-devel@nongnu.org; Thu, 05 Dec 2013 08:15:14 -0500 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:44762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoYll-0002j5-Fv for qemu-devel@nongnu.org; Thu, 05 Dec 2013 08:15:05 -0500 Received: by mail-ea0-f171.google.com with SMTP id h10so11290989eak.2 for ; Thu, 05 Dec 2013 05:15:04 -0800 (PST) Date: Thu, 5 Dec 2013 14:15:01 +0100 From: Stefan Hajnoczi Message-ID: <20131205131501.GB6385@stefanha-thinkpad.redhat.com> References: <1382440906-3852-1-git-send-email-otubo@linux.vnet.ibm.com> <3468561.4aYf2ZG3eq@sifl> <20131122154841.GA3232@stefanha-thinkpad.redhat.com> <7966284.CJrPIyrYnI@sifl> <20131204093946.GA19096@stefanha-thinkpad.redhat.com> <529F2C48.3060304@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <529F2C48.3060304@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH for-1.7] seccomp: setting "-sandbox on" by default List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Otubo Cc: Will Drewry , coreyb@linux.vnet.ibm.com, qemu-devel , Paul Moore , Anthony Liguori , Paolo Bonzini On Wed, Dec 04, 2013 at 11:21:12AM -0200, Eduardo Otubo wrote: > On 12/04/2013 07:39 AM, Stefan Hajnoczi wrote: > >On Fri, Nov 22, 2013 at 11:00:24AM -0500, Paul Moore wrote: > >>>Developers will only be happy with seccomp if it's easy and rewarding to > >>>support/debug. > >> > >>Agreed. > >> > >>As a developer, how do you feel about the audit/syslog based approach I > >>mentioned earlier? > > > >I used the commands you posted (I think that's what you mean). They > >produce useful output. > > > >The problem is that without an error message on stderr or from the > >shell, no one will think "QEMU process dead and hung == check seccomp" > >immediately. It's frustrating to deal with a "silent" failure. > > The process dies with a SIGKILL, and sig handling in Qemu is hard to > implement due to dozen of external linked libraries that has their > own signal masks and conflicts with seccomp. I've already tried this > approach in the past (you can find in the list by searching for > debug mode) I now realize we may be talking past each other. Dying with SIGKILL/SIGSYS is perfectly reasonable and I would be happy with that :-). But I think there's a bug in seccomp: a multi-threaded process can be left in a zombie state. In my case the primary thread was killed by seccomp but another thread was deadlocked on a futex. The result is the process isn't quite dead yet. The shell will not reap it and we're stuck with a zombie. I can reproduce it reliably when I run "qemu-system-x86_64 -sandbox on" on Fedora 20 (qemu-system-x86-1.6.1-2). Should seccomp use do_group_exit() for SIGKILL? Stefan