qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: riku.voipio@linaro.org
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL for-2.0 1/7] linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn
Date: Wed, 19 Mar 2014 16:02:56 +0200	[thread overview]
Message-ID: <7f72cd235fa33f2fc7a8d1cc4d621bf7db61e9eb.1395237255.git.riku.voipio@linaro.org> (raw)
In-Reply-To: <cover.1395237255.git.riku.voipio@linaro.org>

From: Peter Maydell <peter.maydell@linaro.org>

The error path in AArch64 do_rt_sigreturn() which fails before
attempting lock_user_struct() was doing an unlock_user_struct()
on an uninitialized variable. Initialize frame to NULL so we
can use the same error-exit path in all cases (unlock of NULL
is permitted and does nothing).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 24c91f3..209855e 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -1340,7 +1340,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
 
 long do_rt_sigreturn(CPUARMState *env)
 {
-    struct target_rt_sigframe *frame;
+    struct target_rt_sigframe *frame = NULL;
     abi_ulong frame_addr = env->xregs[31];
 
     if (frame_addr & 15) {
-- 
1.8.1.2

  reply	other threads:[~2014-03-19 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 14:02 [Qemu-devel] [PULL for-2.0 0/7] linux-user patches riku.voipio
2014-03-19 14:02 ` riku.voipio [this message]
2014-03-19 14:02 ` [Qemu-devel] [PULL for-2.0 2/7] linux-user: Don't return uninitialized value for atomic_barrier syscall riku.voipio
2014-03-19 14:02 ` [Qemu-devel] [PULL for-2.0 3/7] linux-user: implement F_[GS]ETOWN_EX riku.voipio
2014-03-19 14:02 ` [Qemu-devel] [PULL for-2.0 4/7] linux-user: Don't reserve space for commpage for AArch64 riku.voipio
2014-03-19 14:03 ` [Qemu-devel] [PULL for-2.0 5/7] signal: added a wrapper for sigprocmask function riku.voipio
2014-03-19 14:03 ` [Qemu-devel] [PULL for-2.0 6/7] linux-user: Don't allow guest to block SIGSEGV riku.voipio
2014-03-19 14:03 ` [Qemu-devel] [PULL for-2.0 7/7] linux-user: Implement capget, capset riku.voipio
2014-03-19 15:10   ` Laurent Desnogues
2014-03-19 16:07     ` Peter Maydell
2014-03-19 14:43 ` [Qemu-devel] [PULL for-2.0 0/7] linux-user patches Peter Maydell

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=7f72cd235fa33f2fc7a8d1cc4d621bf7db61e9eb.1395237255.git.riku.voipio@linaro.org \
    --to=riku.voipio@linaro.org \
    --cc=aliguori@amazon.com \
    --cc=peter.maydell@linaro.org \
    --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 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).