From patchwork Wed Mar 12 13:06:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 26090 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 65F37203AB for ; Wed, 12 Mar 2014 13:06:05 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id f11sf22592149qae.11 for ; Wed, 12 Mar 2014 06:06:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=82N/aW2MtsiPi66mr8+zjATaH4hSM8uGKbHmhuOA4w8=; b=L5f5DlH4VXpk5oxAv8LtKHae7GSBMljElNUoiI4kl6H8THSys7Mzq8fvGy5a98zO/1 z3mbU+k7kb3ML+vNqlg/KfkelvlcBc2gtgnyEKri0LFEklbVP+DM4azAutzIjHFSnJH4 db/Sw8yoYrmtK5WbvXCY7HNZVg/ugwCgiXCXvDk5iascEJeNZl9jdWTWg8KInA/Zt445 LbRPpgISSrx140GtLVjPnhO69btCOWoC/4nHSVfFhLH6eoQz3oJtlhOeCwLzhqRzk53/ Fti3Ad5UM1nXo4EU1VRu0PE3YLdBtjmGNeoAvX37vDMFarGZCmd69dGbikv8TVNUEQ2P Q3fw== X-Gm-Message-State: ALoCoQm9DFHsXqTdCJhtgmTk6o86Vdcmwq7qWw5f67Lajbq/3i161unzQEZdeNrpwQ7DzVhW8sjN X-Received: by 10.58.59.104 with SMTP id y8mr6384790veq.18.1394629565210; Wed, 12 Mar 2014 06:06:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.11 with SMTP id g11ls663842qgg.11.gmail; Wed, 12 Mar 2014 06:06:05 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr13193990vcb.22.1394629565095; Wed, 12 Mar 2014 06:06:05 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id tz5si7454249vdc.33.2014.03.12.06.06.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 06:06:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id la4so6580746vcb.17 for ; Wed, 12 Mar 2014 06:06:05 -0700 (PDT) X-Received: by 10.58.161.205 with SMTP id xu13mr32143189veb.4.1394629564991; Wed, 12 Mar 2014 06:06:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp286882vck; Wed, 12 Mar 2014 06:06:04 -0700 (PDT) X-Received: by 10.204.54.131 with SMTP id q3mr17122188bkg.8.1394629564181; Wed, 12 Mar 2014 06:06:04 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id yt2si10404752bkb.134.2014.03.12.06.06.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 12 Mar 2014 06:06:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WNirB-000353-Db; Wed, 12 Mar 2014 13:06:01 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio Subject: [PATCH 1/2] linux-user/signal.c: Correct error path for AArch64 do_rt_sigreturn Date: Wed, 12 Mar 2014 13:06:00 +0000 Message-Id: <1394629561-11813-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394629561-11813-1-git-send-email-peter.maydell@linaro.org> References: <1394629561-11813-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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 c8a1da0..8c4a32d 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1334,7 +1334,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) {