All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Cc: Paul Moore <pmoore@redhat.com>,
	qemu-devel@nongnu.org, Eric Paris <eparis@redhat.com>
Subject: Re: [Qemu-devel] [RFC] Continuous work on sandboxing
Date: Mon, 29 Apr 2013 23:06:08 +0200	[thread overview]
Message-ID: <517EE0C0.2090504@redhat.com> (raw)
In-Reply-To: <517ED0B8.9070607@linux.vnet.ibm.com>

Il 29/04/2013 21:57, Eduardo Otubo ha scritto:
> 
> 
> On 04/26/2013 07:17 PM, Paolo Bonzini wrote:
>> Il 26/04/2013 23:07, Paul Moore ha scritto:
>>>>> 3. Debugging and/or learning mode - third party libraries still
>>>>> have the
>>>>> problem of interfering in the Qemu's signal mask. According to some
>>>>> previous discussions, perhaps patch all external libraries that
>>>>> mass up
>>>>> with this mask (spice, for example) is a way to solve it. But not sure
>>>>> if it worth the time spent. Would like to hear you guys.
>>> I think patching all the libraries is a losing battle, I think we
>>> need to
>>> pursue alternate debugging techniques.
>>
>> It is really only about patching libraries that create threads _and_
>> block all signals in the newly-created thread (to not interfere with the
>> program's own handling of the signals).  In this case, the per-thread
>> signals (SIGFPE/SIGSEGV/SIGBUS/SIGSYS/SIGILL) should be left unblocked,
>> but SIGSYS is often forgotten.
> 
> But otherwise you have a fast way to test third party linked libraries,
> I would have to test it each one manually. How many libraries are linked
> to Qemu today?

I'd wager that most of them are not creating threads.

We could specify our own GThread implementation too (see
https://developer.gnome.org/glib/2.30/glib-Threads.html#GThreadFunctions) that
sets signals correctly, which would cover those libraries that create
threads, but do so via glib.

Another fix would be to set the signal mask around each call to poll.
That's quite expensive however.  There are pselect/ppoll, but Linux
doesn't implement them so they're also expensive.

>> I don't think there are many libraries like this, but fixing SPICE at
>> least should definitely be welcome.
>>
>> In fact QEMU's own util/qemu-thread-posix.c does not unblock those
>> signals.  Eduardo, can you submit a patch for that?
> 
> I sure can.

Thanks,

Paolo

  reply	other threads:[~2013-04-29 21:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 18:39 [Qemu-devel] [RFC] Continuous work on sandboxing Eduardo Otubo
2013-04-26 21:07 ` Paul Moore
2013-04-26 22:17   ` Paolo Bonzini
2013-04-29 19:57     ` Eduardo Otubo
2013-04-29 21:06       ` Paolo Bonzini [this message]
2013-04-29 18:39   ` Eduardo Otubo
2013-04-29 19:24     ` Paul Moore
2013-04-29 22:02     ` Corey Bryant
2013-04-30 18:47       ` Eduardo Otubo
2013-04-30 20:28         ` Corey Bryant
2013-05-01 14:13           ` Paul Moore
2013-05-01 15:30             ` Corey Bryant
2013-04-29 21:52   ` Corey Bryant
2013-04-30 15:24     ` Paul Moore
2013-05-01 17:25       ` Eduardo Otubo
2013-05-01 18:04         ` Corey Bryant

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=517EE0C0.2090504@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=eparis@redhat.com \
    --cc=otubo@linux.vnet.ibm.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.