qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Barcelo <abarcelo@ac.upc.edu>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Riku Voipio <riku.voipio@iki.fi>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] linux-user: SIGSEGV protection on host/guest signal masks
Date: Tue, 25 Sep 2012 09:07:24 +0200	[thread overview]
Message-ID: <CAFKAgTdGhnHJcwDYR9RSOeK-Kci8BA9dM9Pvpie0Jgw--OkFQA@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_ztzeQWfdJQwyb0Z1=g8XV3c+WG_6_sQ9-jcxbTYVMeA@mail.gmail.com>

>> +
>> +/*
>> + * Use SETSIGNAL and GETSIGNAL macros for SIGSEGV protection.
>> + *
>> + * This should protect SIGSEGV unconscious manipulations from guest apps
>> + * (but we still do not let the emulated software play the signal game)
>> + */
>> +#define SETSIGNAL(set) sigdelset( (set), SIGSEGV)
>> +#define GETSIGNAL(get) sigaddset( (get), SIGSEGV)
>> +
>
> I think we could probably structure this in a cleaner way. I think
> it would be better to define and use a wrapper for sigprocmask() which
> was a "do/emulate sigprocmask in way that is safe for guest" (call it
> do_sigprocmask, put it in signal.c). Then we could start with a really
> simple version that just prevents the guest trying to fiddle with
> SIGSEGV, and extend it later to better emulation if necessary (eg
> storing the actual guest signal mask in TaskState so we can emulate
> delivery or otherwise in process_pending_signals(), and so we can
> report the correct thing if the guest later tries to read back the
> signal mask).

Ok, I couldn't find a good way to do this. A sigprocmask wrapper seems
a good idea.


> Note that another place the guest can set the signal mask is via
> sigreturn.

Noted, will check it and add wrapping.

      reply	other threads:[~2012-09-25  7:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 11:23 [Qemu-devel] [PATCH] linux-user: SIGSEGV protection on host/guest signal masks Alex Barcelo
2012-09-24 11:28 ` Alex Barcelo
2012-09-24 12:53 ` Peter Maydell
2012-09-25  7:07   ` Alex Barcelo [this message]

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=CAFKAgTdGhnHJcwDYR9RSOeK-Kci8BA9dM9Pvpie0Jgw--OkFQA@mail.gmail.com \
    --to=abarcelo@ac.upc.edu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).