From: Peter Maydell <peter.maydell@linaro.org>
To: Riku Voipio <riku.voipio@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 08/13] signal/all/do_sigreturn - remove __get_user checks
Date: Sat, 7 Jun 2014 22:34:42 +0100 [thread overview]
Message-ID: <CAFEAcA99BM45OsC6VhGuzneidOGWfDsBQZXF5G3eXqBiO5ipwQ@mail.gmail.com> (raw)
In-Reply-To: <1402048017-30604-9-git-send-email-riku.voipio@linaro.org>
On 6 June 2014 10:46, <riku.voipio@linaro.org> wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
>
> Remove "if(__get_user" checks and their related error paths
> for all architecture's do_sigreturn. Remove the unlock_user_struct
> when the only way to end up there is from failed lock_user_struct.
>
> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
> ---
> linux-user/signal.c | 62 +++++++++++++++++------------------------------------
> 1 file changed, 20 insertions(+), 42 deletions(-)
>
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index 56d6e29..8edf1f9 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -1094,13 +1094,11 @@ long do_sigreturn(CPUX86State *env)
> fprintf(stderr, "do_sigreturn\n");
> #endif
> if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))
> - goto badframe;
> + goto sigsegv;
This change (and the extra sigsegv: label) aren't necessary --
lock_user/unlock_user are written so that if the former fails
it will set the host-pointer variable to NULL, and the latter will
do nothing if handed a NULL host-pointer.
thanks
-- PMM
next prev parent reply other threads:[~2014-06-07 21:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 9:46 [Qemu-devel] [PATCH v2 08/13] signal/all/do_sigreturn - remove __get_user checks riku.voipio
2014-06-07 21:34 ` Peter Maydell [this message]
2014-06-09 12:15 ` [Qemu-devel] [PATCH v3] " riku.voipio
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=CAFEAcA99BM45OsC6VhGuzneidOGWfDsBQZXF5G3eXqBiO5ipwQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@linaro.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 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).