From patchwork Thu Sep 22 12:13:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 76764 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp6694qgf; Thu, 22 Sep 2016 05:36:31 -0700 (PDT) X-Received: by 10.55.99.17 with SMTP id x17mr1723225qkb.261.1474547791369; Thu, 22 Sep 2016 05:36:31 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y63si975471qkc.251.2016.09.22.05.36.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn3Es-0001yR-Q4 for patch@linaro.org; Thu, 22 Sep 2016 08:36:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uF-0008NK-8W for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn2uD-0006Yh-Aa for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:10 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:35408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uD-0006YC-4G for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:09 -0400 Received: by mail-lf0-f53.google.com with SMTP id l131so65696393lfl.2 for ; Thu, 22 Sep 2016 05:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LSOis2WuGark2QTPKGztMQkZtXbLriAGIUfjHyGNU/c=; b=FmuwSwQK5dTRAxIuQhgQ/X3j5/49yaCbeNNbwit+p/cMx5RuIu15rKAIHz3Ha8jQGB iKaiqZ/HGm9Y8TkOXqvIxLNkKTzGQQ2CC8FQyq9ySrk+yEVwaGVGSmwKYo5d/+FIN+Ic lU4ht2xSFpLT6Dp6kMB78aP0BJe4C0xOyiv8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LSOis2WuGark2QTPKGztMQkZtXbLriAGIUfjHyGNU/c=; b=cVf+woPq/HcgndkUmfVI2zihDUJ5Frzqtv5Hw97Wqxg5Aq6Okr3uRL9kOFy3/cQ9As k0d53TmgXfJCxytuZg4Zndm8P3iTbDj+JoNxWiVsnUBExIsi2Un5NeaKOpaPOL5VTVZs s8+o0Jd+WaebS1/LO3cyVpdirXrXkZ1e/ymqtMUqZF+o75FKC+tyV8m99XInrkT7Z3uy nj9Nev3Hz3Zr69IEq/E2LRgnKMKRcZwBVuTHDZOUeLpNVlfslxUx+VraxTFZAFWqOK6y w3zHRQJOM5MRFjdg595mMPFpEeqr5tCGH3O8j1OM1IUAYXdQQo0mZUQF9AQjTpRRkAPt bIKA== X-Gm-Message-State: AE9vXwN39Ad9IBgzrmyw4JANQ63mYYKpCyhcbavynNC9luKKYctEe3FrOquguyCu3+eaxoG8 X-Received: by 10.25.23.222 with SMTP id 91mr769977lfx.182.1474546448421; Thu, 22 Sep 2016 05:14:08 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id u14sm294378lja.11.2016.09.22.05.14.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:14:07 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2016 15:13:33 +0300 Message-Id: <772034b63e9c0caf6c92e31413f2d8df2ee69c88.1474546244.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.53 Subject: [Qemu-devel] [PULL 13/26] linux-user: Check dump_write() return in elf_core_dump() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell One of the calls to dump_write() in elf_core_dump() was missing a check for failure (spotted by Coverity). Add the check to bring it into line with the other calls from this function. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/elfload.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e9a3882..0d07b85 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3050,7 +3050,9 @@ static int elf_core_dump(int signr, const CPUArchState *env) phdr.p_align = ELF_EXEC_PAGESIZE; bswap_phdr(&phdr, 1); - dump_write(fd, &phdr, sizeof (phdr)); + if (dump_write(fd, &phdr, sizeof(phdr)) != 0) { + goto out; + } } /*